forked from donalffons/opencascade.js
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (69 loc) · 2.08 KB
/
updateStarterTemplates.yml
File metadata and controls
78 lines (69 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Update Starter Templates
on:
workflow_dispatch:
inputs:
upgrade:
type: boolean
description: Upgrade dependencies?
jobs:
update:
name: Update Starter Templates
runs-on: ubuntu-latest
steps:
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
- name: Check out repository code
uses: actions/checkout@v2
- run: |
gcloud components install beta
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Upgrade Dependencies
if: github.event.inputs.upgrade == 'true'
run: |
npm install -g npm-check-updates
cd starter-templates
for dir in */
do
dir=${dir%*/}
cd ${dir}
ncu -u -f opencascade.js
npm install
npm install opencascade.js@beta
npm run build
npm run clean
rm node_modules -r
cd ..
done
cd ..
- name: Update Starter Templates
timeout-minutes: 10000
run: |
sudo apt-get update
sudo apt-get install -y zip
cd starter-templates
for dir in */
do
dir=${dir%*/}
zip -r ${dir}.zip ./${dir}
gsutil cp ./${dir}.zip gs://opencascade-js/starter-templates/${dir}.zip
rm ${dir}.zip
done
- name: Commit Changes
if: github.event.inputs.upgrade == 'true'
run: |
git status
git pull
git config --local user.email "action@github.com"
git config --local user.name "github-actions[bot]"
git commit -m "Upgrade starter template dependencies" -a
- name: Push Changes to branch
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}