-
Notifications
You must be signed in to change notification settings - Fork 23
66 lines (55 loc) · 1.96 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
name: Tag repo
on:
push:
tags:
- "*"
env:
REGISTRY: docker.io
permissions:
contents: read
jobs:
release:
permissions:
id-token: write
contents: write
packages: write
runs-on: ubuntu-latest
strategy:
matrix:
component: [webhook, api, operator]
arch: [amd64]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Find current sha version
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
id: sha
- name: Find current tag version
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
id: tag
- uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: run tests to ensure it is still releasable
run: make test
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: v2.5.0
args: release --snapshot --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG: ${{ github.REPOSITORY_OWNER }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push development image into dockerhub
run: |
docker tag ghcr.io/cagip/kubi-${{ matrix.component }}:${{ steps.sha.outputs.sha_short }}-${{ matrix.arch }} ca-gip/kubi-${{ matrix.component }}:${{ steps.sha.outputs.sha_short }}-${{ matrix.arch }}
docker push ca-gip/kubi-${{ matrix.component }}:${{ steps.sha.outputs.sha_short }}-${{ matrix.arch }}
docker tag ghcr.io/cagip/kubi-${{ matrix.component }}:${{ steps.sha.outputs.sha_short }}-${{ matrix.arch }} ca-gip/kubi-${{ matrix.component }}:${{ steps.tag.outputs.version }}
docker push ca-gip/kubi-${{ matrix.component }}:${{ steps.tag.outputs.version }}