Skip to content

Merge pull request #69 from Kuadrant/bump-golang-x-net-v0.55.0 #217

Merge pull request #69 from Kuadrant/bump-golang-x-net-v0.55.0

Merge pull request #69 from Kuadrant/bump-golang-x-net-v0.55.0 #217

Workflow file for this run

name: Build and Publish Images
on:
push:
branches: ["*"]
tags:
- "v[0-9]+.[0-9]+.[0-9]+-?**"
env:
IMG_REGISTRY_HOST: quay.io
IMG_REGISTRY_ORG: kuadrant
IMG_REGISTRY_REPO: developer-portal-controller
jobs:
build:
name: Build and Push image
runs-on: ubuntu-latest
outputs:
image: ${{ steps.meta.outputs.tags }}
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to container registry
uses: docker/login-action@v2
with:
username: ${{ secrets.IMG_REGISTRY_USERNAME }}
password: ${{ secrets.IMG_REGISTRY_TOKEN }}
registry: ${{ env.IMG_REGISTRY_HOST }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/${{ env.IMG_REGISTRY_REPO }}
flavor: |
latest=false
tags: |
# branch event
type=ref,enable=true,priority=600,prefix=,suffix=,event=branch
# git sha
type=raw,value=${{ github.sha }},enable={{is_default_branch}}
# will be used on a push tag event and requires a valid semver Git tag
type=semver,pattern={{raw}}
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
- name: Read release string version
id: release
run: |
version=`make read-release-version`
echo version=$version >> $GITHUB_OUTPUT
- name: Read quay image expiry
id: quay-expiry
run: |
if [[ "${{ github.ref_name }}" == "main" || "${{ github.ref_type }}" == "tag" && "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$ ]]; then
echo "expiry=never" >> $GITHUB_OUTPUT
echo "Setting expiry to 'never' for ref ${{ github.ref_name }}"
else
expiry=`make read-quay-image-expiry`
echo expiry=$expiry >> $GITHUB_OUTPUT
echo "Reading expiry from Makefile, set to $expiry for ref ${{ github.ref_name }}"
fi
- name: Build and Push Image
if: github.repository_owner == 'kuadrant'
id: build-image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
push: true
provenance: false
tags: ${{ steps.meta.outputs.tags }}
build-args: |
GIT_SHA=${{ github.sha }}
DIRTY=false
VERSION=${{ steps.release.outputs.version }}
QUAY_IMAGE_EXPIRY=${{ steps.quay-expiry.outputs.expiry }}
- name: Print Image URL
run: |
echo "Image(s) pushed:"
echo "${{ steps.meta.outputs.tags }}"