Skip to content

Commit

Permalink
.github: Move container registry login (#2984)
Browse files Browse the repository at this point in the history
  • Loading branch information
brancz authored Sep 17, 2024
2 parents 1c8646b + da58bd7 commit 10e4588
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ jobs:
- name: Fetch all tags
run: git fetch --force --tags

- name: Login to registry
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/')
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Login to registry
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Run Goreleaser release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
run: goreleaser release --clean --verbose
Expand All @@ -53,11 +63,6 @@ jobs:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/')
run: echo "tag=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Login to registry
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/')
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push snapshot images
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/')
run: |
Expand Down

0 comments on commit 10e4588

Please sign in to comment.