Skip to content

Commit

Permalink
feat: reaply migrations on sql file changes
Browse files Browse the repository at this point in the history
  • Loading branch information
diyor28 committed Feb 16, 2025
1 parent da21a7c commit 8a9c8b1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .github/workflows/migrate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on:
push:
branches:
- staging
paths:
- '**/*.sql'

jobs:
migrations_redo:
runs-on: gcidp
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run Migrate Redo
run: |
echo "Detected .sql file changes. Running 'migrate redo'..."
docker compose -f compose.staging.yml run --rm erp go run cmd/migrate/main.go redo
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ENTRYPOINT run_server

FROM install AS staging
RUN go build -o run_server cmd/server/main.go && go build -o seed_db cmd/seed/main.go
CMD go run cmd/migrate/main.go redo && /build/seed_db && /build/run_server
CMD go run cmd/migrate/main.go up && /build/seed_db && /build/run_server

FROM install AS testing-ci
#CMD golangci-lint run && go test -v ./...
Expand Down

0 comments on commit 8a9c8b1

Please sign in to comment.