Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 11 additions & 35 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ jobs:
name: backend-image-${{ github.run_number }}
path: /tmp/backend.tar

push_frontend_image:
name: 3. Push Frontend Image
push_images:
name: 3. Push Images to Docker Hub
runs-on: ubuntu-latest
needs: [build_frontend_image, build_backend_image]
steps:
Expand All @@ -84,35 +84,26 @@ jobs:
with:
name: frontend-image-${{ github.run_number }}
path: /tmp
- name: Load and Push Frontend Image
run: |
docker load --input /tmp/frontend.tar
docker push diametrfq/website:latest

push_backend_image:
name: 4. Push Backend Image
runs-on: ubuntu-latest
needs: [build_frontend_image, build_backend_image]
steps:
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Download backend image artifact
uses: actions/download-artifact@v4
with:
name: backend-image-${{ github.run_number }}
path: /tmp
- name: Load and Push Frontend Image
run: |
docker load --input /tmp/frontend.tar
docker push diametrfq/website:latest &
- name: Load and Push Backend Image
run: |
docker load --input /tmp/backend.tar
docker push diametrfq/website-backend:latest
docker push diametrfq/website-backend:latest &
- name: Wait for all pushes to complete
run: wait

deploy_to_server:
name: 5. Deploy to Server
name: 4. Deploy to Server
runs-on: ubuntu-latest
needs: [push_frontend_image, push_backend_image]
needs: [push_images]
steps:
- uses: actions/checkout@v4
- name: Transfer Files to Server
Expand Down Expand Up @@ -147,18 +138,3 @@ jobs:

echo "Cleaning up old images..."
docker system prune -af

cleanup_artifacts:
name: 6. Cleanup Artifacts
runs-on: ubuntu-latest
needs: [deploy_to_server]
if: always()
steps:
- name: Delete build artifacts from current run
uses: geekyeggo/delete-artifact@v5
with:
name: |
frontend-image-${{ github.run_number }}
backend-image-${{ github.run_number }}
useGlob: false
failOnError: false
Loading