Skip to content

Commit

Permalink
Update Docker Image deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrochalskisoldevelo committed Nov 7, 2024
1 parent 0b0aba5 commit 2482298
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/change-log-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
- 'release/**'
- 'rel-*'

jobs:
build-export:
Expand All @@ -24,14 +24,24 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set Version Tag
run: |
branch_name="${GITHUB_REF##*/}"
if [[ "$branch_name" == "main" ]]; then
VERSION_TAG="main"
else
VERSION_TAG=${branch_name/rel-/}
fi
echo "VERSION_TAG=${VERSION_TAG}" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: ./ # Adjust the context to the subdirectory
push: true
tags: |
ghcr.io/openlmis-angola/open-lmis-changelog:latest
ghcr.io/openlmis-angola/open-lmis-changelog:${{ github.ref_name }}
ghcr.io/openlmis-angola/open-lmis-changelog:${{ env.VERSION_TAG }}
- name: Log out of GitHub Container Registry
run: docker logout ghcr.io
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea
.env

0 comments on commit 2482298

Please sign in to comment.