-
Notifications
You must be signed in to change notification settings - Fork 34
66 lines (63 loc) · 1.93 KB
/
push_image.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: Build and push to quay.io
on:
push:
branches: [ main, release-*, workflow-test ]
env:
WF_REGISTRY_USER: netobserv+github_ci
WF_ORG: netobserv
WF_MULTIARCH_TARGETS: amd64 arm64 ppc64le s390x
WF_VERSION: ${{ github.ref_name }}
jobs:
push-image:
name: push image
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.22']
steps:
- name: install make
run: sudo apt-get install make
- name: set up go 1.x
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: checkout
uses: actions/checkout@v3
- name: docker login to quay.io
uses: docker/login-action@v2
with:
username: ${{ env.WF_REGISTRY_USER }}
password: ${{ secrets.QUAY_SECRET }}
registry: quay.io
- name: get short sha
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: build and push manifest with images
run: |
MULTIARCH_TARGETS="${{ env.WF_MULTIARCH_TARGETS }}" IMAGE_ORG=${{ env.WF_ORG }} VERSION=${{ env.WF_VERSION }} CLEAN_BUILD=1 make images
MULTIARCH_TARGETS="${{ env.WF_MULTIARCH_TARGETS }}" IMAGE_ORG=${{ env.WF_ORG }} VERSION=${{ env.short_sha }} CLEAN_BUILD=1 OCI_BUILD_OPTS="--label quay.expires-after=2w" make images
codecov:
name: Codecov upload
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.22']
steps:
- name: install make
run: sudo apt-get install make
- name: set up go 1.x
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: checkout
uses: actions/checkout@v3
- name: Test
run: make test coverage-report
- name: Report coverage
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./cover.out
flags: unittests
fail_ci_if_error: true
verbose: true