ci: apply migrations before starting staging containers
This commit is contained in:
1 parent
c22d484c11
commit
a80cb9fea7
4 files changed
+38
-1
No files matched your search
@@ -48,6 +48,15 @@ jobs:
|
||||
labels: |
|
||||
org.opencontainers.image.ref.name=${{ github.head_ref || github.ref_name }}
|
||||
|
||||
- name: Build migrate docker image
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.migrate
|
||||
push: true
|
||||
tags: git.jt4d.ru/${{ github.repository }}/api:${{ github.head_ref || github.ref_name }}-migrate
|
||||
cache-from: git.jt4d.ru/${{ github.repository }}/api:latest
|
||||
|
||||
deploy-staging:
|
||||
name: Деплой на стейджинг
|
||||
runs-on: ubuntu-latest
|
||||
@@ -78,6 +87,7 @@ jobs:
|
||||
sed -i "s/\${BRANCH}/$BRANCH/g" docker-compose.yml
|
||||
docker compose pull --quiet
|
||||
staging-db-postgres create "${{ github.repository }}" "$BRANCH"
|
||||
docker compose run --rm migrate
|
||||
docker compose down
|
||||
docker compose up -d
|
||||
|
||||
|
||||
Reference in new issue
Block a user