Skip to content

Go

Go #16

Workflow file for this run

name: Go
env:
REGISTRY: ghcr.io
GITHUB_TOKEN: ${{ github.token }}
on:
push:
branches:
- main
pull_request: {}
schedule:
- cron: '3 0 * * *'
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{github.ref}}
jobs:
build:
runs-on: ubuntu-latest
name: Build ${{ matrix.version }}
env:
LATEST: 1.23
strategy:
matrix:
version:
- 1.22
- 1.23
permissions:
contents: read
packages: write
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: "${{ env.REGISTRY }}/${{ github.repository }}/go"
tags: |
type=raw,value=${{ matrix.version }}
${{ matrix.version == env.LATEST && 'type=raw,value=latest' || '' }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: "${{ env.REGISTRY }}"
username: "${{ github.actor }}"
password: "${{ secrets.GITHUB_TOKEN }}"
- name: Build image
id: build
uses: docker/build-push-action@v6
with:
context: ./go
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
build-args:
GO_VERSION=${{ matrix.version }}
push: true