Skip to content

Set vars in Makefile and bump go to 1.19 to enable FIPS-compliant bui… #5

Set vars in Makefile and bump go to 1.19 to enable FIPS-compliant bui…

Set vars in Makefile and bump go to 1.19 to enable FIPS-compliant bui… #5

Workflow file for this run

name: Container build & push jobs
on:
push:
branches:
- master
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
jobs:
build_push_container:
runs-on: ubuntu-latest
name: Build and push the container image for a commit or tag.
steps:
- name: Checkout code into the Go module directory.
uses: actions/checkout@v3
- name: Login to Quay.io
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Cache for Docker's buildx
uses: actions/cache@v3
with:
path: .buildxcache/
key: ${{ runner.os }}-buildx-${{ hashFiles('**/*.go', 'Dockerfile', 'go.sum') }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Snapshot container buid & push
run: make conditional-container-build-push
- name: Check semver tag
id: check-semver-tag
# The regex below comes from https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string.
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ ]]; then
echo ::set-output name=match::true
fi
- name: Release container build & push
if: steps.check-semver-tag.outputs.match == 'true'
run: make container-release-build-push