add workflow to run migrations

This commit is contained in:
jc 2024-04-22 23:49:12 -04:00 committed by Jc
commit e7b7ff1571

23
.github/workflows/migrate.yml vendored Normal file
View file

@ -0,0 +1,23 @@
name: Run Migrations
on:
push:
branches:
- 'main'
jobs:
migrate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@4
- name: Install golang-migarte
run: |
curl -L https://github.com/golang-migrate/migrate/releases/download/v4.17.1/migrate.linux-amd64.tar.gz | tar xvz
sudo mv migrate /usr/local/bin/
- name: Run migrations
run: migrate -database "$DB_URL" -path ./migrations up
env:
DB_URL: ${{ secrets.DB_URL }}