Skip to content

Update to Go v1.21 #441

Update to Go v1.21

Update to Go v1.21 #441

Workflow file for this run

name: Test and Build
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
test-build:
name: test-build
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/setup-go@v2
with:
go-version: ^1.21
- name: Test
run: make test
- name: Build
run: make build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/${{ github.repository }}
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=pr
type=semver,pattern={{raw}}
type=sha
- name: Login to GitHub Packages
if: github.event_name != 'pull_request'
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish a docker image
uses: docker/[email protected]
with:
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}