fix: add migrations service to docker-compose and update build workflow for migrations image
Build and deploy / build (push) Successful in 20s
Build and deploy / deploy (push) Successful in 15s

This commit is contained in:
k1nq
2025-11-30 00:18:19 +05:00
parent ef6b6d598e
commit 0e48023258
3 changed files with 51 additions and 3 deletions
+7 -1
View File
@@ -21,6 +21,11 @@ jobs:
docker build -t ${{ secrets.GIT_HOST }}/${{ gitea.repository }}:app -f app/Dockerfile .
docker push ${{ secrets.GIT_HOST }}/${{ gitea.repository }}:app
- name: Build and push migrations image
run: |
docker build -t ${{ secrets.GIT_HOST }}/${{ gitea.repository }}:migrations -f migrations/Dockerfile .
docker push ${{ secrets.GIT_HOST }}/${{ gitea.repository }}:migrations
deploy:
runs-on: ubuntu-latest
needs: build
@@ -28,7 +33,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Instasll SSH key
- name: Install SSH key
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.DEPLOY_SSH_KEY }}
@@ -47,6 +52,7 @@ jobs:
ssh ${{ secrets.LXC_USER }}@${{ secrets.LXC_HOST }} << 'EOF'
echo "${{ secrets.TOKEN }}" | docker login ${{ secrets.GIT_HOST }} -u ${{ secrets.USERNAME }} --password-stdin
docker pull ${{ secrets.GIT_HOST }}/${{ gitea.repository }}:app
docker pull ${{ secrets.GIT_HOST }}/${{ gitea.repository }}:migrations
cd /srv/app
docker compose up -d --force-recreate
docker image prune -f