Sync Database Schemas #7292
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: Sync Database Schemas | |
on: | |
schedule: | |
- cron: "*/10 * * * *" # run every 10 minutes | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
env: | |
DATABASE_CONNECTION_STRING: ${{ secrets.DATABASE_CONNECTION_STRING }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Pull Schema | |
run: | | |
npm ci | |
npm run db:pull | |
npx @biomejs/biome format --write ./database/migrations | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v6 | |
- name: Log Pull Request Info | |
if: ${{ steps.cpr.outputs.pull-request-number }} | |
run: | | |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | |
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |