forked from gythialy/golang-cross
-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (42 loc) · 1.33 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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.23"
- "1.22"
- "1.21"
debver:
- bullseye
- bookworm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
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@v5
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) }},tykio/golang-cross:${{ matrix.tag || format( '{0}-{1}-pgo', matrix.gover, matrix.debver) }}
build-args: |
GO_VERSION=${{ matrix.gover }}
DEB_VERSION=${{ matrix.debver }}