This repository has been archived by the owner on Feb 13, 2024. It is now read-only.
Release & Publish #88
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: Release & Publish | |
on: | |
create: | |
tags: | |
- v* | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Check out code" | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: "Set up Go" | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.18 | |
- name: "Create release on GitHub" | |
uses: goreleaser/goreleaser-action@v3 | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
with: | |
args: "release --rm-dist" | |
version: latest | |
publish: | |
name: "Publish to DockerHub" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Check out code" | |
uses: actions/checkout@v3 | |
- name: "Set up QEMU" | |
uses: docker/[email protected] | |
- name: "Set up Docker Buildx" | |
uses: docker/[email protected] | |
- name: "Login to DockerHub" | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: "Build and push" | |
id: docker_build | |
uses: docker/[email protected] | |
with: | |
push: true | |
build-args: "VERSION=${{ github.ref_name }}" | |
tags: "${{ github.repository }}:latest,${{ github.repository }}:${{ github.ref_name }}" | |
- name: "Image digest" | |
run: echo ${{ steps.docker_build.outputs.digest }} |