Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Release & Publish

Release & Publish #95

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 }}