diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5d404e9..6e5b16b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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: @@ -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 @@ -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