Skip to content

update: add Docker build and push workflow with multi-stage build sup… #16

update: add Docker build and push workflow with multi-stage build sup…

update: add Docker build and push workflow with multi-stage build sup… #16

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
env:
GO_VERSION: 1.21
permissions: write-all
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: k8spider
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata for the Docker image
id: meta
uses: docker/metadata-action@v5
with:
images: k8spider/k8spider
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest
type=sha
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Go Environment
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Install UPX
uses: crazy-max/ghaction-upx@v3
with:
install-only: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release
env:
CGO_ENABLED: 0
# GITHUB_TOKEN: ${{ secrets.RELEASE_GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}