From cfe84fe742692a9829b33966c53363357aad6942 Mon Sep 17 00:00:00 2001 From: TimofeyTst Date: Sun, 8 Oct 2023 13:23:53 +0300 Subject: [PATCH] if in steps --- .github/workflows/main.yml | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 052519e..5eede2e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,33 +30,29 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - build_and_push: - needs: docker_setup - if: github.ref != 'refs/heads/prod' - runs-on: ubuntu-latest - steps: - - name: Build and push + - name: Build and push Dockerfile + if: github.ref != 'refs/heads/prod' uses: docker/build-push-action@v5 with: push: true file: Dockerfile tags: ${{ steps.meta.outputs.tags }} - - deploy: - needs: docker_setup - if: github.ref == 'refs/heads/prod' - runs-on: ubuntu-latest - steps: - - name: Build and push + - name: Build and push Dockerfile.prod + if: github.ref == 'refs/heads/prod' uses: docker/build-push-action@v5 with: push: true file: Dockerfile tags: ${{ steps.meta.outputs.tags }} + + deploy: + needs: docker_setup + if: github.ref == 'refs/heads/prod' + runs-on: ubuntu-latest + steps: - name: Checkout code uses: actions/checkout@v4