Skip to content

Commit

Permalink
Add permissions for pushing Docker images to GitHub (#4006)
Browse files Browse the repository at this point in the history
* Add permissions for pushing Docker images to GitHub
* Add Docker Hub login
* Restore Docker Hub images to goreleaser
  • Loading branch information
clouvet authored Oct 16, 2024
1 parent 99f38a7 commit ea488ce
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:

permissions:
contents: write
packages: write

# concurrency:
# group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -81,6 +82,17 @@ jobs:
with:
path: dist/${{ matrix.GOOS }}
key: ${{ matrix.GOOS }}-${{ needs.meta.outputs.sha_short }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
if: steps.cache.outputs.cache-hit != 'true' # do not run if cache hit
uses: goreleaser/goreleaser-action@v5
Expand Down
2 changes: 2 additions & 0 deletions .goreleaser.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ dockers:
- goos: linux
goarch: amd64
image_templates:
- "flyio/flyctl:latest"
- "flyio/flyctl:v{{ .Version }}"
- "ghcr.io/superfly/flyctl:latest"
- "ghcr.io/superfly/flyctl:v{{ .Version }}"
skip_push: auto
Expand Down

0 comments on commit ea488ce

Please sign in to comment.