Skip to content

Commit

Permalink
Determine dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
TimofeyTst committed Oct 8, 2023
1 parent 57f3c49 commit e9f4ea7
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,22 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Determine Dockerfile
id: dockerfile
run: |
if [ "$GITHUB_REF" == "refs/heads/prod" ]; then
echo "Using Dockerfile.prod"
echo "::set-output name=dockerfile::Dockerfile.prod"
else
echo "Using Dockerfile"
echo "::set-output name=dockerfile::Dockerfile"
fi
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
file: |
if [ "$GITHUB_REF" == "refs/heads/prod" ]; then
echo "Dockerfile.prod"
else
echo "Dockerfile"
fi
file: ${{ steps.dockerfile.outputs.dockerfile }}
tags: ${{ steps.meta.outputs.tags }}


Expand Down

0 comments on commit e9f4ea7

Please sign in to comment.