From 9a125d73d104e8293ece782f3540727137cd2147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D0=B5=D0=B3=20=D0=93=D0=BE=D0=B2=D0=BE=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D1=81=D0=BA=D0=B8=D0=B9?= Date: Sun, 29 Sep 2024 15:58:51 +0500 Subject: [PATCH] test build --- .github/workflows/prod_deploy.yaml | 33 +++++++++++++----------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/.github/workflows/prod_deploy.yaml b/.github/workflows/prod_deploy.yaml index 35366d27..002f5793 100644 --- a/.github/workflows/prod_deploy.yaml +++ b/.github/workflows/prod_deploy.yaml @@ -1,13 +1,9 @@ name: Production deploy on: - workflow_run: - workflows: - - Build and push Docker image - types: - - completed + push: branches: - - master + - feature/convert_ci-cd_to_the_prod env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} @@ -44,28 +40,28 @@ jobs: poetry run pytest working-directory: adaptive_hockey_federation - build_and_push: + build: needs: pytest runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v4 - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 + - name: Log in to the Container registry + uses: docker/login-action@v3.0.0 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata for Docker + + - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v5 + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build and push Docker image for Production - uses: docker/build-push-action@v5 + + - name: Build and push Docker image + uses: docker/build-push-action@v5.3.0 with: context: . file: infra/prod/prod.Dockerfile @@ -73,11 +69,10 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - deploy: name: Deploy changes on server runs-on: ubuntu-latest - needs: [pytest, build_and_push] + needs: pytest environment: name: prod_deploy steps: