forked from gythialy/golang-cross
-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (62 loc) · 1.76 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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 }}