Skip to content

Commit

Permalink
Update GitHub release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Oct 3, 2023
1 parent c7e3093 commit e17050d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
13 changes: 9 additions & 4 deletions .github/actions/get-version-tag/action.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
name: Get version tag

outputs:
version-tag:
description: "Version tag"
value: ${{ steps.version-tag.outputs.VERSION }}

runs:
using: "composite"
steps:
- uses: actions/checkout@v3
- name: Get tag from branch, tag or release
- id: version-tag
name: Get tag from branch, tag or release
run: |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "main" ] && VERSION=latest
[ "$VERSION" == "develop" ] && VERSION=latest
[ "$VERSION" == "main" ] && VERSION=develop
[ "$VERSION" == "develop" ] && VERSION=develop
echo "Version: $VERSION"
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/cd-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Build
uses: ./.github/actions/docker-build
with:
version: ${{ steps.version-tag.outputs.VERSION }}
version: ${{ steps.version-tag.outputs.version-tag }} # (feature/abc)
github-token: ${{ secrets.GITHUB_TOKEN }}
docker-image-name: ${{ vars.DOCKER_IMAGE_NAME }}
- name: Install AWS CLI
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cd-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Build
uses: ./.github/actions/docker-build
with:
version: ${{ steps.version-tag.outputs.VERSION }} # (latest)
version: ${{ steps.version-tag.outputs.version-tag }} # (develop)
github-token: ${{ secrets.GITHUB_TOKEN }}
docker-image-name: ${{ vars.DOCKER_IMAGE_NAME }}
- name: Install AWS CLI
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Build
uses: ./.github/actions/docker-build
with:
version: ${{ steps.version-tag.outputs.VERSION }}
version: ${{ steps.version-tag.outputs.version-tag }} # (23.09.24.1)
latest: true
github-token: ${{ secrets.GITHUB_TOKEN }}
docker-image-name: ${{ vars.DOCKER_IMAGE_NAME }}
Expand Down

0 comments on commit e17050d

Please sign in to comment.