Fixes oneAgent pod restarts after operator version change (#1912) #40
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: Publish images | |
on: | |
push: | |
tags: | |
- v[0-9]+.[0-9]+.[0-9]+ | |
permissions: | |
contents: read | |
id-token: write | |
jobs: | |
prepare: | |
name: Prepare properties | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
- name: Prepare build parameters | |
id: prep | |
run: | | |
hack/build/ci/prepare-build-variables.sh | |
- name: Docker metadata | |
uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 # v4.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 }} | |
build: | |
name: Build images | |
runs-on: ubuntu-latest | |
needs: [prepare] | |
strategy: | |
matrix: | |
platform: [amd64, arm64] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
- 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, arm64] | |
registry: [gcr, dockerhub] | |
include: | |
- registry: gcr | |
url: gcr.io | |
repository: GCR_REPOSITORY | |
username: GCR_USERNAME | |
password: GCR_JSON_KEY | |
- registry: dockerhub | |
url: docker.io | |
repository: DOCKERHUB_REPOSITORY | |
username: DOCKERHUB_USERNAME | |
password: DOCKERHUB_PASSWORD | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
- name: Login to Registry | |
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0 | |
with: | |
registry: ${{ matrix.url }} | |
username: ${{ secrets[matrix.username] }} | |
password: ${{ secrets[matrix.password] }} | |
- 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: Sign image for ${{matrix.registry}} | |
uses: ./.github/actions/sign-image | |
with: | |
image: ${{ matrix.url }}/${{ secrets[matrix.repository] }}:${{ needs.prepare.outputs.version }}-${{ matrix.platform }} | |
signing-key: ${{ secrets.COSIGN_PRIVATE_KEY }} | |
signing-password: ${{ secrets.COSIGN_PASSWORD }} | |
push-rhcc: | |
name: Push amd64 image to RHCC | |
environment: Release | |
needs: [prepare, build] | |
runs-on: ubuntu-latest | |
env: | |
SCAN_REGISTRY: "quay.io" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
- name: Login to Registry | |
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0 | |
with: | |
registry: ${{ env.SCAN_REGISTRY }} | |
username: ${{ secrets.RHCC_USERNAME }} | |
password: ${{ secrets.RHCC_PASSWORD }} | |
- name: Push amd64 image to scan registry | |
uses: ./.github/actions/upload-image | |
with: | |
platform: "amd64" | |
labels: ${{ needs.prepare.outputs.labels }} | |
version: ${{ needs.prepare.outputs.version }} | |
registry: ${{ env.SCAN_REGISTRY }} | |
repository: ${{ secrets.RHCC_REPOSITORY }} | |
skip-platform-suffix: true | |
- name: Run preflight | |
uses: ./.github/actions/preflight | |
with: | |
version: ${{ needs.prepare.outputs.version }} | |
registry: ${{ env.SCAN_REGISTRY }} | |
repository: ${{ secrets.RHCC_REPOSITORY }} | |
report-name: "preflight.json" | |
redhat-project-id: ${{ secrets.REDHAT_PROJECT_ID }} | |
pyxis-api-token: ${{ secrets.PYXIS_API_TOKEN }} | |
manifest: | |
name: Create manifest | |
environment: Release | |
needs: [prepare, push] | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
strategy: | |
matrix: | |
registry: [gcr, dockerhub] | |
include: | |
- registry: gcr | |
url: gcr.io | |
repository: GCR_REPOSITORY | |
username: GCR_USERNAME | |
password: GCR_JSON_KEY | |
- registry: dockerhub | |
url: docker.io | |
repository: DOCKERHUB_REPOSITORY | |
username: DOCKERHUB_USERNAME | |
password: DOCKERHUB_PASSWORD | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
- name: Login to Registry | |
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0 | |
with: | |
registry: ${{ matrix.url }} | |
username: ${{ secrets[matrix.username] }} | |
password: ${{ secrets[matrix.password] }} | |
- name: Create manifests for ${{matrix.registry}} | |
uses: ./.github/actions/create-manifests | |
with: | |
version: ${{ needs.prepare.outputs.version }} | |
registry: ${{ matrix.url }} | |
repository: ${{ secrets[matrix.repository] }} | |
combined: true | |
- name: Sign manifests for ${{matrix.registry}} | |
uses: ./.github/actions/sign-image | |
with: | |
image: ${{ matrix.url }}/${{ secrets[matrix.repository] }}:${{ needs.prepare.outputs.version }} | |
signing-key: ${{ secrets.COSIGN_PRIVATE_KEY }} | |
signing-password: ${{ secrets.COSIGN_PASSWORD }} |