@@ -3,69 +3,67 @@ name: BuildAndDeployDevBranch
3
3
on :
4
4
push :
5
5
branches-ignore :
6
- - ' master'
6
+ - " master"
7
7
jobs :
8
8
build-and-deploy :
9
9
permissions :
10
- contents : ' read'
11
- id-token : ' write'
12
- deployments : ' write'
10
+ contents : " read"
11
+ id-token : " write"
12
+ deployments : " write"
13
13
strategy :
14
- matrix :
15
- node-version :
16
- - ' 16.x '
14
+ matrix :
15
+ node-version :
16
+ - " 20.x "
17
17
runs-on : ubuntu-latest
18
18
steps :
19
- - uses : actions/checkout@v2
20
- - name : Use Node.js ${{ matrix.node-version }}
21
- uses : actions/setup-node@v1
22
- with :
23
- node-version : ${{ matrix.node-version }}
24
- - uses : actions/cache@v3
25
- with :
26
- path : " **/node_modules"
27
- key : ${{ runner.os }}-${{ matrix.node-version }}-node_modules-${{ hashFiles('**/package-lock.json') }}
28
- - run : npm install
29
- - name : Typecheck with TypeScript
30
- run : npm run typecheck
31
- - name : Build client bundles
32
- run : node ./node_modules/neuroglancer/config/esbuild-cli.js --config=min --no-typecheck --define CONFIG=$(cat config/ng-extend.json | tr -d ' \t\n\r') --define STATE_SERVERS=$(cat config/state_servers.json | tr -d " \t\n\r") --define CUSTOM_BINDINGS=$(cat config/custom-keybinds.json | tr -d " \t\n\r")
33
- - run : cp -r ./dist/min appengine/frontend/static/
34
- - name : Get branch name (merge)
35
- if : github.event_name != 'pull_request'
36
- shell : bash
37
- run : echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
38
- - name : Get branch name (pull request)
39
- if : github.event_name == 'pull_request'
40
- shell : bash
41
- run : echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
42
- - run : echo "BRANCH_NAME_URL=$(echo ${{ env.BRANCH_NAME }} | tr / - | tr _ -)" >> $GITHUB_ENV
43
- - name : start deployment
44
- uses : bobheadxi/deployments@v1
45
- id : deployment
46
- with :
47
- step : start
48
- token : ${{ secrets.GITHUB_TOKEN }}
49
- env : ${{ env.BRANCH_NAME }}
50
- desc : Setting up staging deployment for ${{ env.BRANCH_NAME }}
51
- - id : ' auth'
52
- uses : ' google-github-actions/auth@v1'
53
- with :
54
- workload_identity_provider : ' projects/483670036293/locations/global/workloadIdentityPools/neuroglancer-github/providers/github'
55
- service_account :
' [email protected] '
56
- - id : deploy
57
- uses : google-github-actions/deploy-appengine@main
58
- with :
59
- version : ${{ env.BRANCH_NAME_URL }}
60
- deliverables : appengine/frontend/app.yaml
61
- promote : false
62
- - name : update deployment status
63
- uses : bobheadxi/deployments@v1
64
- if : always()
65
- with :
66
- step : finish
67
- token : ${{ secrets.GITHUB_TOKEN }}
68
- env : ${{ steps.deployment.outputs.env }}
69
- env_url : ${{ steps.deploy.outputs.url }}
70
- status : ${{ job.status }}
71
- deployment_id : ${{ steps.deployment.outputs.deployment_id }}
19
+ - uses : actions/checkout@v2
20
+ - name : Use Node.js ${{ matrix.node-version }}
21
+ uses : actions/setup-node@v1
22
+ with :
23
+ node-version : ${{ matrix.node-version }}
24
+ - uses : actions/cache@v3
25
+ with :
26
+ path : " **/node_modules"
27
+ key : ${{ runner.os }}-${{ matrix.node-version }}-node_modules-${{ hashFiles('**/package-lock.json') }}
28
+ - run : npm install
29
+ - name : Build client bundles
30
+ run : npm run build
31
+ - run : cp -r ./dist appengine/frontend/static/
32
+ - name : Get branch name (merge)
33
+ if : github.event_name != 'pull_request'
34
+ shell : bash
35
+ run : echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
36
+ - name : Get branch name (pull request)
37
+ if : github.event_name == 'pull_request'
38
+ shell : bash
39
+ run : echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
40
+ - run : echo "BRANCH_NAME_URL=$(echo ${{ env.BRANCH_NAME }} | tr / - | tr _ -)" >> $GITHUB_ENV
41
+ - name : start deployment
42
+ uses : bobheadxi/deployments@v1
43
+ id : deployment
44
+ with :
45
+ step : start
46
+ token : ${{ secrets.GITHUB_TOKEN }}
47
+ env : ${{ env.BRANCH_NAME }}
48
+ desc : Setting up staging deployment for ${{ env.BRANCH_NAME }}
49
+ - id : " auth"
50
+ uses : " google-github-actions/auth@v1"
51
+ with :
52
+ workload_identity_provider : " projects/483670036293/locations/global/workloadIdentityPools/neuroglancer-github/providers/github"
53
+ service_account :
" [email protected] "
54
+ - id : deploy
55
+ uses : google-github-actions/deploy-appengine@main
56
+ with :
57
+ version : ${{ env.BRANCH_NAME_URL }}
58
+ deliverables : appengine/frontend/app.yaml
59
+ promote : false
60
+ - name : update deployment status
61
+ uses : bobheadxi/deployments@v1
62
+ if : always()
63
+ with :
64
+ step : finish
65
+ token : ${{ secrets.GITHUB_TOKEN }}
66
+ env : ${{ steps.deployment.outputs.env }}
67
+ env_url : ${{ steps.deploy.outputs.url }}
68
+ status : ${{ job.status }}
69
+ deployment_id : ${{ steps.deployment.outputs.deployment_id }}
0 commit comments