Skip to content

Build golang-helper Image #141

Build golang-helper Image

Build golang-helper Image #141

name: Build golang-helper Image
on:
push:
paths:
- '**'
schedule:
- cron: '5 0 */15 * *'
workflow_dispatch:
# Build docker image for golang latest, 1.23, 1.22, 1.21
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
GO_VERSION: ["alpine", "1.23-alpine", "1.22-alpine", "1.21-alpine"]
include:
- GO_VERSION: "alpine"
output_image: "thomas2500/golang-helper:latest"
- GO_VERSION: "1.23-alpine"
output_image: "thomas2500/golang-helper:1.23"
- GO_VERSION: "1.22-alpine"
output_image: "thomas2500/golang-helper:1.22"
- GO_VERSION: "1.21-alpine"
output_image: "thomas2500/golang-helper:1.21"
name: Build golang-helper Image
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
id: docker_build
with:
context: .
push: true
tags: ${{ matrix.output_image }}
build-args: |
GO_VERSION=${{ matrix.GO_VERSION }}