-
Notifications
You must be signed in to change notification settings - Fork 30
91 lines (79 loc) · 2.84 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: release
on:
workflow_dispatch:
push:
branches:
- 'master'
jobs:
build:
name: Release
environment: ci-cd
# UPDATE_HERE
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: ubuntu-22.04
steps:
# UPDATE_HERE
# https://github.com/actions/checkout/releases
- uses: actions/checkout@v4
name: Check out code
with:
fetch-tags: 'true'
fetch-depth: 0
- name: Set up Docker variables
id: set_variables
run: |
VERSION=$(make image_tag)
echo "SOPS_SEC_OPERATOR_VERSION=$VERSION" >> $GITHUB_ENV
SKIP_RELEASE=$(git tag -l "${VERSION}")
echo "IMAGE_FULL_NAME=$(make image_full_name)" >> $GITHUB_ENV
echo "IMAGE_LATEST_NAME=$(make image_latest_name)" >> $GITHUB_ENV
echo "IMAGE_CACHE_NAME=$(make image_cache_name)" >> $GITHUB_ENV
echo "SKIP_RELEASE=${SKIP_RELEASE}" >> $GITHUB_ENV
- name: Skip release
if: env.SKIP_RELEASE != ''
run: |
echo "Skip release, tag found for ${VERSION}"
# UPDATE_HERE
# https://github.com/asdf-vm/actions/releases
- name: Install asdf tools
if: env.SKIP_RELEASE == ''
uses: asdf-vm/actions/install@v3
# UPDATE_HERE
# https://github.com/docker/setup-qemu-action/releases
- name: Set up QEMU
if: env.SKIP_RELEASE == ''
uses: docker/setup-qemu-action@v3
# UPDATE_HERE
# https://github.com/docker/setup-buildx-action/releases
- name: Set up Docker Buildx
if: env.SKIP_RELEASE == ''
uses: docker/setup-buildx-action@v3
# UPDATE_HERE
# https://github.com/docker/login-action/releases
- name: Log in to Docker Hub
if: env.SKIP_RELEASE == ''
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASS }}
- name: Tag and release
if: env.SKIP_RELEASE == ''
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
git tag "${SOPS_SEC_OPERATOR_VERSION}"
git push origin --tags
git-chglog "${SOPS_SEC_OPERATOR_VERSION}" > chglog.tmp
gh release create "${SOPS_SEC_OPERATOR_VERSION}" -F chglog.tmp
# UPDATE_HERE
# https://github.com/docker/build-push-action/releases
- name: Docker build
if: env.SKIP_RELEASE == ''
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ env.IMAGE_LATEST_NAME }},${{ env.IMAGE_FULL_NAME }}
platforms: linux/amd64,linux/arm64
cache-from: type=registry,ref=${{ env.IMAGE_CACHE_NAME }}
cache-to: type=registry,ref=${{ env.IMAGE_CACHE_NAME }},mode=max