-
Notifications
You must be signed in to change notification settings - Fork 16
68 lines (59 loc) · 1.92 KB
/
deploy-hasura.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
# NOTE: This name appears in GitHub's Checks API and in workflow's status badge.
name: deploy-hasura
env:
HASURA_GRAPHQL_ADMIN_SECRET: ${{ secrets.HASURA_GRAPHQL_ADMIN_SECRET }}
HASURA_GRAPHQL_ENDPOINT: ${{ vars.HASURA_GRAPHQL_ENDPOINT }}
HASURA_GRAPHQL_DATABASE_URL: ${{ secrets.HASURA_GRAPHQL_DATABASE_URL }}
DBT_TARGET: "production"
GOOGLE_CREDENTIALS_JSON: ${{ vars.GOOGLE_TEST_DUMMY_CREDENTIALS_JSON }}
GOOGLE_PROJECT_ID: opensource-observer
# Trigger the workflow when:
on:
# A push occurs to one of the matched branches.
push:
branches:
- main
paths:
- apps/hasura2/**
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
deploy-hasura:
# NOTE: This name appears in GitHub's Checks API.
name: deploy-hasura
environment: deploy
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- name: Set up Node.js 20
uses: actions/setup-node@v4
with:
cache: "pnpm"
node-version: "20.x"
- name: "Setup Python, Poetry and Dependencies"
uses: packetcoders/action-setup-cache-python-poetry@main
with:
python-version: 3.12
poetry-version: 1.8.2
- name: Login to google
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GOOGLE_BQ_ADMIN_CREDENTIALS_JSON }}'
create_credentials_file: true
- name: Setup dbt profile
run: |
bash .github/scripts/create-dbt-profile.sh ${GOOGLE_APPLICATION_CREDENTIALS}
- name: Build
run: pnpm build:hasura
- name: Deploy
run: pnpm deploy:hasura