Skip to content

Commit

Permalink
Push docker latest tag only when tags are on main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
z4kn4fein committed Jan 10, 2024
1 parent b99ab62 commit 4b032c1
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/proxy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Test with race
run: go test -race ./...

release-docker:
release-docker-version-tag:
runs-on: ubuntu-latest
needs: [ test ]

Expand All @@ -50,9 +50,32 @@ jobs:
context: .
push: true
tags: |
configcat/proxy:latest
configcat/proxy:${{ env.VERSION }}
release-docker-latest-tag:
runs-on: ubuntu-latest
needs: [ test ]
if: endsWith(github.event.base_ref, 'main') == true
steps:
- uses: actions/checkout@v4

- name: Get version from tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
configcat/proxy:latest
release-goreleaser:
runs-on: ubuntu-latest
needs: [ test ]
Expand Down

0 comments on commit 4b032c1

Please sign in to comment.