-
Notifications
You must be signed in to change notification settings - Fork 17
50 lines (50 loc) · 1.25 KB
/
db-migration.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
name: Migrate/undo DB migration
on:
workflow_dispatch:
inputs:
action:
description: Action to be done on the DB
required: true
default: migrate
type: choice
options:
- migrate
- undo
environment:
description: Which environment's database to run on
required: true
default: staging
type: choice
options:
- staging
- production
jobs:
set_environment:
outputs:
current_env: ${{ steps.set-environment.outputs.current_env }}
runs-on: ubuntu-latest
steps:
- id: set-environment
run: echo "::set-output name=current_env::${{ inputs.environment }}"
run_migration:
runs-on: ubuntu-latest
needs: [set_environment]
defaults:
run:
working-directory: ./backend
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: "16"
- name: Run migration
env:
DB_URI: ${{ secrets.DB_URI }}
run: |
cd ../shared
npm ci
npm run build
cd ../backend
npm ci
npm run build
npm run db:${{ inputs.action }} -- --config build/database/config-ci.js