build: k8s api version bump to 1.31.1 (#188) #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |