-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 1.94 KB
/
deploy.yml
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
name: GAE Deploy
on:
push:
branches:
- master
jobs:
check_change_in_web:
name: Check changes in WEB
outputs:
run_job: ${{ steps.check_files.outputs.run_job }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 2
- name: check modified files
id: check_files
run: |
echo "=============== list modified files ==============="
git diff --name-only HEAD^ HEAD
echo "========== check paths of modified files =========="
git diff --name-only HEAD^ HEAD > files.txt
while IFS= read -r file
do
echo $file
if [[ $file != web/* ]]; then
echo "This modified file is not under the 'web' folder."
echo "::set-output name=run_job::false"
break
else
echo "::set-output name=run_job::true"
fi
done < files.txt
build:
name: V1 Build & Deploy
needs: check_change_in_web
if: needs.check.outputs.run_job == 'true'
runs-on: ubuntu-latest
env:
dir: ./web
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Node Setup
uses: actions/setup-node@v4
with:
node-version: 12
- name: GAE Setup
uses: google-github-actions/setup-gcloud@master
with:
project_id: ${{ secrets.PROJECT_ID }}
service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS}}
- name: NPM Install WWW
run: npm ci
working-directory: ${{env.dir}}
- name: Build WWW
run: npm run build
working-directory: ${{env.client}}
# Deploy App to App Engine
- name: Deploy
run: |
gcloud app deploy web/app.yaml dispatch.yaml --quiet