forked from kurator-dev/kurator
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (39 loc) · 1.19 KB
/
release-image.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
name: Build and Push Images
on:
push:
tags:
- "v*.*.*"
jobs:
build-push:
permissions:
id-token: write # To be able to get OIDC ID token to sign images.
runs-on: ubuntu-latest
steps:
- name: Get image version
run: |
echo "image_version=$(echo ${GITHUB_REF##*/v})" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
- name: Install Cosign
uses: sigstore/[email protected]
with:
cosign-release: 'v1.13.1'
- name: Compile
run: make build
- name: Build Docker Image
run: VERSION=${{ env.image_version }} make docker
- name: Sign Image
env:
VERSION: ${{ env.image_version }}
COSIGN_EXPERIMENTAL: 1
SIGN_IMAGE: 1
run: make sign-image
- name: Login to ghcr.io
# This is where you will update the PAT to GITHUB_TOKEN
run: echo "${{ secrets.GH_PAT }}" | docker login ghcr.io -u $ --password-stdin
- name: Push Docker Image
run: VERSION=${{ env.image_version }} make docker-push