Skip to content

Commit

Permalink
feat: updated release action (#63)
Browse files Browse the repository at this point in the history
* updated release action
  • Loading branch information
diegolagospagopa authored Oct 3, 2024
1 parent 2af1261 commit 9f8f243
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
35 changes: 34 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,47 @@ jobs:
echo "TAG_FORMAT=v\${version}" >> $GITHUB_OUTPUT
fi
- name: 🚀 Release with docker action
- name: 🚀 Release
id: release
uses: pagopa/eng-github-actions-iac-template/global/release-action@release-with-
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_format: ${{ steps.set-tag-format.outputs.TAG_FORMAT }}
branches: ${{ github.ref_name }}

- name: Log in to the Github Container registry
id: docker_login
if: steps.release.outputs.new_release_published == 'true'
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 #v3.2.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set Docker tags
id: set_docker_tags
if: steps.release.outputs.new_release_published == 'true'
run: |
if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
echo "DOCKER_TAGS=ghcr.io/${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:${{ steps.release.outputs.new_release_version }}" >> $GITHUB_OUTPUT
elif [[ "${{ github.ref }}" == "refs/heads/uat" ]]; then
echo "DOCKER_TAGS=ghcr.io/${{ github.repository }}:${{ steps.release.outputs.new_release_version }},ghcr.io/${{ github.repository }}:uat-latest" >> $GITHUB_OUTPUT
elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "DOCKER_TAGS=ghcr.io/${{ github.repository }}:${{ steps.release.outputs.new_release_version }}" >> $GITHUB_OUTPUT
fi
- name: Build and push Docker image with release version
id: docker_build_push
if: steps.release.outputs.new_release_published == 'true'
uses: docker/build-push-action@1a162644f9a7e87d8f4b053101d1d9a712edc18c #v6.3.0
with:
context: .
push: true
tags: ${{ steps.set_docker_tags.outputs.DOCKER_TAGS }}
labels: |
maintainer=https://pagopa.it
org.opencontainers.image.source=https://github.com/${{ github.repository }}
# - name: Trigger Azure DevOps pipeline
# if: github.ref == 'refs/heads/develop'
# uses: Azure/pipelines@v1
Expand Down
2 changes: 1 addition & 1 deletion force-release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1634
1645

0 comments on commit 9f8f243

Please sign in to comment.