-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (46 loc) · 1.36 KB
/
ci-cd.yaml
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
name: CI / CD
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm install echarts
- run: cd front; npm install; cd ..
- run: cd front; npm run build; cd ..
- run: npm install
- run: npx playwright install --with-deps
- run: npm run test-ASB
deploy:
needs: [test]
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Authenticate to Google Cloud
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
run: |
echo '${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}' > /tmp/credentials.json
gcloud auth activate-service-account --key-file=/tmp/credentials.json
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: 'sos2324-dic-asb'
- name: Use gcloud CLI
run: gcloud info
- name: Install npm dependencies
run: npm install echarts
- name: Install frontend dependencies
run: |
cd front
npm install
cd ..
- name: Build frontend
run: |
cd front
npm run build
cd ..
- name: Deploy to App Engine
run: gcloud app deploy --quiet