-
-
Notifications
You must be signed in to change notification settings - Fork 195
71 lines (62 loc) · 2.01 KB
/
release.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
name: Release & Publish
on:
create:
tags:
- v*
jobs:
release:
name: "Release binary"
runs-on: ubuntu-latest
steps:
- name: "Check out code"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "Set up Go"
uses: actions/setup-go@v4
with:
go-version: 1.19
- name: "Create release on GitHub"
uses: goreleaser/[email protected]
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
args: "release --clean"
version: latest
publish:
name: "Publish to GHCR"
runs-on: ubuntu-latest
steps:
- name: "Check out code"
uses: actions/checkout@v3
- name: "Login to GitHub Container Registry"
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Build Docker Images"
uses: docker/[email protected]
with:
push: false
build-args: "VERSION=${{ github.ref_name }}"
tags: "${{ github.repository }}:latest,${{ github.repository }}:${{ github.ref_name }}"
- name: "Slim Images (latest)"
uses: kitabisa/docker-slim-action@v1
with:
target: "${{ github.repository }}:latest"
overwrite: true
env:
DSLIM_HTTP_PROBE: false
- name: "Slim Images (versioing)"
uses: kitabisa/docker-slim-action@v1
with:
target: "${{ github.repository }}:${{ github.ref_name }}"
overwrite: true
env:
DSLIM_HTTP_PROBE: false
- name: "Re-tagging & Push Images"
run: |
docker tag ${{ github.repository }}:latest ghcr.io/${{ github.repository }}:latest
docker tag ${{ github.repository }}:${{ github.ref_name }} ghcr.io/${{ github.repository }}:${{ github.ref_name }}
docker push ghcr.io/${{ github.repository }} -a