Use GH_PAT instead of GITHUB_TOKEN #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: goreleaser | |
on: | |
push: | |
tags: | |
- '*' | |
permissions: | |
contents: write | |
jobs: | |
goreleaser: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |
dockerize-and-push: | |
runs-on: ubuntu-latest | |
needs: goreleaser | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
target: final | |
push: true | |
tags: | | |
${{ secrets.DOCKERHUB_USERNAME }}/gtfocli:latest | |
${{ secrets.DOCKERHUB_USERNAME }}/gtfocli:${{ github.ref_name }} |