♻️ Update all in production #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
jobs: | |
update: | |
environment: | |
name: ${{ inputs.environment }} | |
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_ENV: ${{ secrets.FLOW_DATABASE_ENV }} | |
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 }} | |
TARGET_DATABASE_HOST: ${{ secrets.TARGET_DATABASE_HOST }} | |
TARGET_DATABASE_NAME: ${{ secrets.TARGET_DATABASE_NAME }} | |
TARGET_DATABASE_PASSWORD: ${{ secrets.TARGET_DATABASE_PASSWORD }} | |
TARGET_DATABASE_PORT: ${{ secrets.TARGET_DATABASE_PORT }} | |
TARGET_DATABASE_USER: ${{ secrets.TARGET_DATABASE_USER }} | |
name: Update database | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: Initialize database service from compose | |
uses: hoverkraft-tech/compose-action@v2.0.2 | |
with: | |
compose-file: "compose.ci.yml" | |
- 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=${{ inputs.build }} npm run flow |