Skip to content

Commit

Permalink
GH-2285 Add Docker tags for Major and Major.Minor versions (Resolve #…
Browse files Browse the repository at this point in the history
…2282)

Adding new step`Generate Docker Tags` to the `Docker` pipeline to fetch
the major and minor version of the application and use it in the last
step for additional docker tags
  • Loading branch information
kirbylink authored Nov 23, 2024
1 parent a805475 commit 849c18d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,20 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: "Generate Docker Tags"
id: generate-tags
run: |
VERSION="${{ needs.github.outputs.version }}"
MAJOR=$(echo $VERSION | cut -d '.' -f 1)
MINOR=$(echo $VERSION | cut -d '.' -f 2)
echo "::set-output name=tags::dzikoysk/reposilite:latest,dzikoysk/reposilite:${VERSION},dzikoysk/reposilite:${MAJOR},dzikoysk/reposilite:${MAJOR}.${MINOR},ghcr.io/dzikoysk/reposilite:latest,ghcr.io/dzikoysk/reposilite:${VERSION},ghcr.io/dzikoysk/reposilite:${MAJOR},ghcr.io/dzikoysk/reposilite:${MAJOR}.${MINOR}"
- name: "Build and push"
id: docker_build
uses: docker/build-push-action@v3
with:
context: .
platforms: "linux/amd64,linux/arm64"
push: true
tags: |
dzikoysk/reposilite:latest
dzikoysk/reposilite:${{ needs.github.outputs.version }}
ghcr.io/dzikoysk/reposilite:latest
ghcr.io/dzikoysk/reposilite:${{ needs.github.outputs.version }}
tags: ${{ steps.generate-tags.outputs.tags }}

0 comments on commit 849c18d

Please sign in to comment.