Run Scripts #2
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: Run PostgreSQL scripts | |
on: workflow_dispatch | |
jobs: | |
run_scripts: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Read JSON and run scripts | |
run: | | |
scripts=$(jq -r '.scripts[]' migrations/spec.json) | |
for script in $scripts; do | |
psql -d ${{ secrets.DB_URL }} -a -f migrations/$script | |
done | |
working-directory: ${{ github.workspace }} |