Release #145
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]+ # include prerelease tags too | |
jobs: | |
prepare: | |
permissions: | |
contents: read | |
id-token: write | |
name: Prepare properties | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Prepare build parameters | |
id: prep | |
run: | | |
hack/build/ci/prepare-build-variables.sh | |
- name: Docker metadata | |
uses: docker/metadata-action@31cebacef4805868f9ce9a0cb03ee36c32df2ac4 # v5.3.0 | |
id: meta | |
with: | |
images: dynatrace/dynatrace-operator | |
tags: ${{ steps.prep.outputs.docker_image_tag }} | |
labels: | | |
${{ steps.prep.outputs.docker_image_labels }} | |
vcs-ref=${{ github.sha }} | |
outputs: | |
labels: ${{ steps.meta.outputs.labels }} | |
version: ${{ steps.prep.outputs.docker_image_tag }} | |
version_without_prefix: ${{ steps.prep.outputs.docker_image_tag_without_prefix }} | |
build: | |
name: Build images | |
runs-on: ubuntu-latest | |
needs: [prepare] | |
strategy: | |
matrix: | |
platform: [amd64] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Build image | |
uses: ./.github/actions/build-image | |
with: | |
platform: ${{ matrix.platform }} | |
labels: ${{ needs.prepare.outputs.labels }} | |
image-tag: ${{ needs.prepare.outputs.version }} | |
push: | |
name: Push images | |
environment: Release | |
needs: [prepare, build] | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
strategy: | |
matrix: | |
platform: [amd64] | |
registry: [amazon-ecr] | |
include: | |
- registry: amazon-ecr | |
url: public.ecr.aws | |
repository: ECR_REPOSITORY | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Login to Registry | |
if: ${{ matrix.registry != 'amazon-ecr' }} | |
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | |
with: | |
registry: ${{ matrix.url }} | |
username: ${{ secrets[matrix.username] }} | |
password: ${{ secrets[matrix.password] }} | |
- name: Configure aws credentials | |
if: ${{ matrix.registry == 'amazon-ecr' }} | |
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1 | |
with: | |
role-to-assume: ${{ secrets.ECR_IMAGEPUSH_ROLE }} | |
aws-region: us-east-1 | |
- name: Login to Amazon ECR | |
if: ${{ matrix.registry == 'amazon-ecr' }} | |
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1 | |
with: | |
registry-type: public | |
- name: Push ${{matrix.platform}} to ${{matrix.registry}} | |
uses: ./.github/actions/upload-image | |
with: | |
platform: ${{ matrix.platform }} | |
labels: ${{ needs.prepare.outputs.labels }} | |
version: ${{ needs.prepare.outputs.version }} | |
registry: ${{ matrix.url }} | |
repository: ${{ secrets[matrix.repository] }} | |
- name: Get image digest | |
id: digest | |
env: | |
IMAGE: ${{ matrix.url }}/${{ secrets[matrix.repository] }}:${{ needs.prepare.outputs.version }}-${{ matrix.platform }} | |
run: | | |
hack/build/ci/get-image-digest.sh | |
manifest: | |
name: Create Docker manifests | |
environment: Release | |
needs: [prepare, push] | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
outputs: | |
digest: ${{ steps.create-manifests.outputs.digest }} | |
strategy: | |
matrix: | |
registry: [amazon-ecr] | |
include: | |
- registry: amazon-ecr | |
url: public.ecr.aws | |
repository: ECR_REPOSITORY | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Login to Registry | |
if: ${{ matrix.registry != 'amazon-ecr' }} | |
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | |
with: | |
registry: ${{ matrix.url }} | |
username: ${{ secrets[matrix.username] }} | |
password: ${{ secrets[matrix.password] }} | |
- name: Configure aws credentials | |
if: ${{ matrix.registry == 'amazon-ecr' }} | |
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1 | |
with: | |
role-to-assume: ${{ secrets.ECR_IMAGEPUSH_ROLE }} | |
aws-region: us-east-1 | |
- name: Login to Amazon ECR | |
if: ${{ matrix.registry == 'amazon-ecr' }} | |
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1 | |
with: | |
registry-type: public | |
- name: Create manifests for ${{matrix.registry}} | |
uses: ./.github/actions/create-manifests | |
id: create-manifests | |
with: | |
version: ${{ needs.prepare.outputs.version }} | |
registry: ${{ matrix.url }} | |
repository: ${{ secrets[matrix.repository] }} | |
combined: true |