github workflow: improve desc and upgrade consistently actions versions #14
Workflow file for this run
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: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
- 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+' | |
jobs: | |
build: | |
env: | |
context: "./" | |
controlplane_image_name: "openshift-capi-agent-controlplane" | |
bootstrap_image_name: "openshift-capi-agent-bootstrap" | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get version | |
id: get_version | |
run: | | |
VERSION="${GITHUB_REF#refs/tags/}" | |
echo "Releasing ${VERSION}" | |
echo "VERSION=${VERSION//v}" >> $GITHUB_ENV | |
- name: Set tags on manifests | |
id: set_tag_manifests | |
run: | | |
sed -i "s,quay.io/edge-infrastructure/openshift-capi-agent-bootstrap:latest,${{ secrets.REGISTRY_SERVER }}/${{ secrets.REGISTRY_NAMESPACE }}/${{ env.controlplane_image_name }}:${{env.VERSION}}," bootstrap-components.yaml | |
sed -i "s,quay.io/edge-infrastructure/openshift-capi-agent-controlplane:latest,${{ secrets.REGISTRY_SERVER }}/${{ secrets.REGISTRY_NAMESPACE }}/${{ env.controlplane_image_name }}:${{env.VERSION}}," controlplane-components.yaml | |
- name: Login to Quay.io | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ secrets.REGISTRY_SERVER }} | |
username: ${{ secrets.REGISTRY_USERNAME }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- name: Build and publish bootstrap image to Quay | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
context: ${{ env.context }} | |
tags: "${{ secrets.REGISTRY_SERVER }}/${{ secrets.REGISTRY_NAMESPACE }}/${{ env.controlplane_image_name }}:${{env.VERSION}}, ${{ secrets.REGISTRY_SERVER }}/${{ secrets.REGISTRY_NAMESPACE }}/${{ env.controlplane_image_name }}:latest" | |
build-args: "PROVIDER=bootstrap" | |
- name: Build and publish controplane image to Quay | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
context: ${{ env.context }} | |
tags: "${{ secrets.REGISTRY_SERVER }}/${{ secrets.REGISTRY_NAMESPACE }}/${{ env.controlplane_image_name }}:${{env.VERSION}}, ${{ secrets.REGISTRY_SERVER }}/${{ secrets.REGISTRY_NAMESPACE }}/${{ env.controlplane_image_name }}:latest" | |
build-args: "PROVIDER=controlplane" | |
- name: Create GitHub Release | |
uses: softprops/[email protected] | |
with: | |
name: 'Release ${{ env.VERSION }}' | |
files: | | |
controlplane-components.yaml | |
bootstrap-components.yaml | |
metadata.yaml | |
generate_release_notes: true | |
draft: false | |
prerelease: ${{ contains(env.VERSION, 'rc') }} |