Create Github Release for Docker Image and Binary #56
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: build-release | |
run-name: Create Github Release for Docker Image and Binary | |
on: | |
push: | |
tags: | |
- v* | |
permissions: | |
contents: write | |
id-token: write | |
packages: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go 1.21 | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.21 | |
- name: Download dependencies | |
run: go mod download | |
- name: Test | |
run: go test -v ./... | |
- name: Github Docker Login | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GH_PAT }} | |
- name: Build binaries, image and archive | |
uses: goreleaser/goreleaser-action@v5 | |
if: success() && startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |
FURY_TOKEN: ${{ secrets.FURY_TOKEN }} | |
with: | |
version: latest | |
args: release --clean |