Skip to content

Publish Images

Publish Images #111

Workflow file for this run

name: Publish Images
on:
push:
branches:
- master
schedule:
- cron: '0 0 * * 1' # Run every Monday at 12:00 AM UTC
pull_request:
workflow_dispatch:
jobs:
build:
name: go ${{ matrix.tag || format( '{0}-{1}', matrix.gover, matrix.debver) }}
strategy:
fail-fast: false
matrix:
gover:
- "1.17"
- "1.18"
- "1.19"
- "1.20"
debver:
- buster
- bullseye
include:
- gover: "1.15"
debver: stretch
tag: "1.15-el7"
- gover: "1.15"
debver: buster
tag: "1.15"
- gover: "1.16"
debver: stretch
tag: "1.16-el7"
- gover: "1.16"
debver: buster
tag: "1.16"
- gover: "1.16"
debver: buster
tag: "1.16-buster"
- gover: "1.16"
debver: bullseye
tag: "1.16-bullseye"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push go ${{ matrix.tag || format( '{0}-{1}', matrix.gover, matrix.debver) }} based image
uses: docker/build-push-action@v4
with:
push: ${{ github.ref_name == 'master' }}
pull: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: tykio/golang-cross:${{ matrix.tag || format( '{0}-{1}', matrix.gover, matrix.debver) }}
build-args: |
GO_VERSION=${{ matrix.gover }}
DEB_VERSION=${{ matrix.debver }}