-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (69 loc) · 2.69 KB
/
update-api-database.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
69
70
71
name: ♻️ Update api database
run-name: "♻️ Update ${{ inputs.build }} in ${{ inputs.environment }}"
on:
workflow_dispatch:
inputs:
build:
description: "The data domain to update"
type: choice
required: true
options:
- all
- admin
- capital-planning
- pluto
environment:
description: "The database environment to update"
type: choice
required: true
options:
- staging
- production
push:
branches:
- ty/53-follow-up
jobs:
update:
environment:
name: staging
env:
DO_SPACES_ACCESS_KEY: ${{ secrets.DO_SPACES_ACCESS_KEY }}
DO_SPACES_ENDPOINT: ${{ secrets.DO_SPACES_ENDPOINT }}
DO_SPACES_SECRET_KEY: ${{ secrets.DO_SPACES_SECRET_KEY }}
FLOW_DATABASE_HOST: ${{ secrets.FLOW_DATABASE_HOST }}
FLOW_DATABASE_NAME: ${{ secrets.FLOW_DATABASE_NAME }}
FLOW_DATABASE_PASSWORD: ${{ secrets.FLOW_DATABASE_PASSWORD }}
FLOW_DATABASE_PORT: ${{ secrets.FLOW_DATABASE_PORT }}
FLOW_DATABASE_USER: ${{ secrets.FLOW_DATABASE_USER }}
name: Update database
runs-on: ubuntu-latest
services:
postgres:
image: postgis/postgis:15-3.4-alpine
env:
POSTGRES_USER: ${{ secrets.FLOW_DATABASE_USER }}
POSTGRES_PASSWORD: ${{ secrets.FLOW_DATABASE_PASSWORD }}
POSTGRES_DB: ${{ secrets.FLOW_DATABASE_NAME }}
TARGET_DATABASE_USER: ${{ secrets.TARGET_DATABASE_USER }}
TARGET_DATABASE_PASSWORD: ${{ secrets.TARGET_DATABASE_PASSWORD }}
TARGET_DATABASE_NAME: ${{ secrets.TARGET_DATABASE_NAME }}
TARGET_DATABASE_PORT: ${{ secrets.TARGET_DATABASE_PORT }}
TARGET_DATABASE_HOST: ${{ secrets.TARGET_DATABASE_HOST }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: checkout code
uses: actions/checkout@v4
- name: install node
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: install node dependencies
run: npm ci
- name: run flow
run: BUILD=all npm run flow