Skip to content

Commit

Permalink
Merge pull request #21 from Gabriel-Trintinalia/test-conditional-release
Browse files Browse the repository at this point in the history
Respect tag version when publishing docker for releases
  • Loading branch information
Gabriel-Trintinalia authored Aug 13, 2024
2 parents 72f1a3d + a4eebe4 commit 3793ae8
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
types: [released]

jobs:
publish:
docker_publish:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -45,6 +45,15 @@ jobs:
username: ${{ secrets.DOCKER_USER_RW }}
password: ${{ secrets.DOCKER_PAT_RW }}

- name: Get the version
if: github.event_name == 'release'
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Build and Publish Docker Image
run: |
./gradlew -PdockerOrgName=${{ secrets.DOCKER_ORG_NAME }} -Pdocker-platform=linux/arm64 distDocker
if [ "${{ github.event_name }}" == "release" ]; then \
./gradlew -PdockerOrgName=${{ secrets.DOCKER_ORG_NAME }} -Pdocker-platform=linux/arm64 distDocker -PreleaseVersion=${{ steps.get_version.outputs.VERSION }}; \
else \
./gradlew -PdockerOrgName=${{ secrets.DOCKER_ORG_NAME }} -Pdocker-platform=linux/arm64 distDocker; \
fi

0 comments on commit 3793ae8

Please sign in to comment.