Skip to content

Commit

Permalink
[TASK] Build and push docker image for all branches with according tags
Browse files Browse the repository at this point in the history
  • Loading branch information
jgrehling committed Aug 17, 2023
1 parent 4d0bb1d commit 5f80bae
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,20 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Get docker tag for master
if: github.ref == 'refs/heads/master'
shell: bash
run: echo "DOCKER_TAG=latest" >> $GITHUB_ENV

- name: Get branch for all other branches
if: github.ref != 'refs/heads/master'
shell: bash
run: echo "DOCKER_TAG=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV

- name: Build and push Docker image
# Uses v2.7.0, sha1 is used for better security
uses: docker/build-push-action@a66e35b9cbcf4ad0ea91ffcaf7bbad63ad9e0229
with:
context: .
push: true
tags: intera/ci-php-ant:latest,intera/ci-php-ant:7.2-ubuntu,intera/docker-ci-php-ant:latest,intera/docker-ci-php-ant:7.2-ubuntu
tags: intera/ci-php-ant:${{ env.DOCKER_TAG }},intera/docker-ci-php-ant:${{ env.DOCKER_TAG }}

0 comments on commit 5f80bae

Please sign in to comment.