Skip to content

Commit

Permalink
Only publish images to repo on tag, distinguish between latest and la…
Browse files Browse the repository at this point in the history
…test-lts
  • Loading branch information
manisandro committed Oct 20, 2023
1 parent 2c560a9 commit 0016dc0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ jobs:
build:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push'
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:

- uses: actions/checkout@master

- name: Get version tag
id: get_tag
run: |
if [ ${{ startsWith(github.ref, 'refs/tags/') }} = true ]; then
echo "tag=latest,${GITHUB_REF:10}" >>$GITHUB_OUTPUT
if [ ${{ endsWith(github.ref, '-lts') }} = true ]; then
echo "tag=latest-lts,${GITHUB_REF:10}" >>$GITHUB_OUTPUT
else
echo "tag=latest" >>$GITHUB_OUTPUT
echo "tag=latest,${GITHUB_REF:10}" >>$GITHUB_OUTPUT
fi
- name: Build and publish docker image
Expand Down

0 comments on commit 0016dc0

Please sign in to comment.