-
Notifications
You must be signed in to change notification settings - Fork 2
37 lines (35 loc) · 1.26 KB
/
sync-staging-db.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
name: Weekly staging database sync
on:
schedule:
# Runs Sunday at 00:00 (https://crontab.guru/#0_0_*_*_0)
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
build:
name: Seed Database
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install pulumi
uses: pulumi/setup-pulumi@v2
- run: |
echo "HASURA_GRAPHQL_ADMIN_SECRET=$(pulumi config get hasura-admin-secret --stack staging)" >> $GITHUB_ENV
working-directory: infrastructure/application
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
- run: |
echo "PG_URL=$(pulumi stack output --stack staging --show-secrets dbRootUrl)" >> $GITHUB_ENV
working-directory: infrastructure/data
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm install -g pnpm
working-directory: scripts/seed-database
- run: pnpm install
working-directory: scripts/seed-database
- run: node ./upsert-production-flows.js --overwrite
working-directory: scripts/seed-database
env:
HASURA_GRAPHQL_URL: https://hasura.editor.planx.dev/v1/graphql