-
Notifications
You must be signed in to change notification settings - Fork 350
83 lines (70 loc) · 2.64 KB
/
gh-packages.yaml
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
71
72
73
74
75
76
77
78
79
80
81
82
83
name: gh-package-deploy
permissions: {}
on:
push:
tags:
- '*'
env:
REGISTRY: ghcr.io
IMAGE_NAME: "${{ github.repository }}"
jobs:
docker:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
# Adding this block will overridw default values to None if not specified in the block
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions:
contents: read
actions: read
packages: write # to push packages
steps:
- name: Checkout
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
# https://www.npmjs.com/package/semver#caret-ranges-123-025-004
go-version: '^1.21'
check-latest: true
- name: Login to Github Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-ecosystem/action-get-latest-tag@b7c32daec3395a9616f88548363a42652b22d435
id: get-latest-tag
- name: Build Skipper Packages
run: |
cd packaging
make build.linux
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
id: meta
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
labels: |
org.opencontainers.image.licenses=Apache-2.0
org.opencontainers.image.vendor=Zalando SE
- name: Build and push
uses: docker/build-push-action@32945a339266b759abcbdc89316275140b0fc960
with:
context: ./packaging
build-args: BASE_IMAGE=golang:alpine
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}