-
-
Notifications
You must be signed in to change notification settings - Fork 553
49 lines (41 loc) · 1.34 KB
/
push_main.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
# GitHub Actions workflow
# https://help.github.com/actions
name: Push (main)
on:
push:
branches: [main]
env:
VERSION: ${{ github.event.pull_request.number }}
HUSKY: 0
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 19
cache: "yarn"
# Install dependencies
- run: yarn install
# Authenticate Google Cloud SDK
- name: gcloud auth activate-service-account
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ github.workspace }}/gcp-key.json
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
run: |
echo "$GCP_SA_KEY" | base64 --decode > "$GOOGLE_APPLICATION_CREDENTIALS"
gcloud auth activate-service-account --key-file="$GOOGLE_APPLICATION_CREDENTIALS"
# Build
- run: yarn workspace app build
- run: yarn workspace api build
# Deploy
# - run: yarn db migrate --seed --env=test
# - run: yarn workspace api deploy --env=test
# env:
# GOOGLE_APPLICATION_CREDENTIALS: ${{ github.workspace }}/gcp-key.json
# SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY }}
# - run: yarn workspace edge deploy --env=test
# env:
# CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}