-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (51 loc) · 1.42 KB
/
deploy-gae.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
name: Deploy to GAE
on:
push:
branches:
- 'main'
- 'develop'
pull_request:
types:
- opened
- synchronize
jobs:
auto_deploy_gae:
permissions: write-all
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- name: Setup Node.js 18
uses: actions/setup-node@v2
with:
node-version: 18
- uses: actions/checkout@v2
- name: 'Generate .env'
run: |
echo "${{ secrets.ENV_CONTENTS }}" > .env
- name: yarn install
run: yarn install
- name: yarn build
run: yarn build
- id: 'auth'
uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: 'Extract branch name'
id: branch-name
shell: bash
run: |
short_ref=${GITHUB_REF#refs/*/}
formatted_ref=$(echo "$short_ref" | tr '[:upper:]' '[:lower:]' | tr '/' '-')
echo "short_ref=${formatted_ref}" >> $GITHUB_ENV
- name: 'Deploy to App Engine'
id: 'deploy'
uses: 'google-github-actions/deploy-appengine@v0'
with:
deliverables: 'app.yaml'
version: ${{ env.short_ref }}
promote: ${{ env.short_ref =='main' }}
- name: 'update repo detail website'
env:
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
run: |
gh repo edit -h ${{steps.deploy.outputs.url}}