Skip to content

Commit

Permalink
if in steps
Browse files Browse the repository at this point in the history
  • Loading branch information
TimofeyTst committed Oct 8, 2023
1 parent de8ab5b commit cfe84fe
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit cfe84fe

Please sign in to comment.