-
Notifications
You must be signed in to change notification settings - Fork 23
57 lines (48 loc) · 1.62 KB
/
build.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
name: pr
on:
push:
pull_request:
env:
REGISTRY: ghcr.io
jobs:
pr-tests:
name: Build and test images
runs-on: ubuntu-latest
strategy:
matrix:
component: [webhook, api, operator]
arch: [amd64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Find current tag version
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
id: tags
- uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: run tests
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 container registry
# Pull requests are targetting ca-gip/kubi and should not push an image
# Only push images for the fork's repository
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push development image into ghcr (packages)
# Pull requests are targetting ca-gip/kubi and should not push an image
# Only push images for the fork's repository
if: github.event_name != 'pull_request'
run: |
docker push ${{ env.REGISTRY }}/${{ github.REPOSITORY_OWNER }}/kubi-${{ matrix.component }}:${{ steps.tags.outputs.sha_short }}-${{ matrix.arch }}