-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (56 loc) · 1.75 KB
/
production.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
57
58
59
60
61
62
63
64
65
name: Deploy to Production
on:
workflow_dispatch:
inputs:
branch:
description: 'Enter github branch name to be deployed'
required: true
default: 'main'
description:
description: 'Enter description about deployment'
required: true
default: 'New feature release'
env:
PROJECT_ID: ${{ secrets.GKE_PROJECT }}
GAR_LOCATION: us-west1
GKE_CLUSTER: plg
GKE_ZONE: us-west1
jobs:
setup-build-publish-deploy:
name: Setup, Build, Publish, and Deploy
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.branch }}
- uses: actions/checkout@v2
with:
repository: "TrueSparrowSystems/dev.secrets"
ref: "master"
token: ${{ secrets.PAT }}
path: "secrets"
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- name: Build and generate static page
run: |-
mv secrets/whisper-chain-fe/frontend.prod.env .env
cat .env
sudo apt install -y curl
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs
npm install
npx next build
npx next export
cd out
gsutil -h "Cache-Control:public, max-age=0" rsync -r ./ gs://whisperchain.xyz/
- name: Purge cache
uses: jakejarvis/cloudflare-purge-action@master
env:
# Zone is required by both authentication methods
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}