Skip to content

Commit

Permalink
push major version with every release
Browse files Browse the repository at this point in the history
This seems to be common practice within GH actions. This commit will
overwrite the v1 tag whenever we release a new version
  • Loading branch information
SimonTheLeg committed Jul 20, 2022
1 parent 226f8c2 commit 53105e5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: build and push container-image
# TODO also push to the major @v1 versions
run: |
IMAGE_NAME="ghcr.io/simontheleg/semver-tag-from-pr-action"
MAJOR_VERSION=${GITHUB_REF_NAME%%.*}
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
docker build . -t ${IMAGE_NAME}:${GITHUB_REF_NAME}
docker tag ${IMAGE_NAME}:${GITHUB_REF_NAME} ${IMAGE_NAME}:${MAJOR_VERSION}
docker push ${IMAGE_NAME}:${GITHUB_REF_NAME}
docker push ${IMAGE_NAME}:${MAJOR_VERSION}
- name: publish GH release
uses: softprops/action-gh-release@v1
with:
Expand Down

0 comments on commit 53105e5

Please sign in to comment.