add workflow to run migrations
This commit is contained in:
parent
93731a987e
commit
e7b7ff1571
1 changed files with 23 additions and 0 deletions
23
.github/workflows/migrate.yml
vendored
Normal file
23
.github/workflows/migrate.yml
vendored
Normal 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 }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue