Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
simplify publish image workflow to just test logic
Browse files Browse the repository at this point in the history
  • Loading branch information
wepudt committed May 31, 2023
1 parent eb24538 commit d8dabc7
Showing 1 changed file with 7 additions and 79 deletions.
86 changes: 7 additions & 79 deletions .github/workflows/publish-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+-rc.* # include prerelease tags too
- v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+ # include prerelease tags too

permissions:
contents: read
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
needs: [prepare]
strategy:
matrix:
platform: [amd64, arm64]
platform: [amd64]
steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
Expand All @@ -60,7 +60,7 @@ jobs:
id-token: write
strategy:
matrix:
platform: [amd64, arm64]
platform: [amd64]
registry: [gcr, dockerhub]
include:
- registry: gcr
Expand All @@ -69,39 +69,12 @@ jobs:
username: GCR_USERNAME
password: GCR_JSON_KEY
- registry: dockerhub
url: docker.io
url: quay.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: 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
- name: Sign image for ${{matrix.registry}}
uses: ./.github/actions/sign-image
with:
image: ${{ matrix.url }}/${{ secrets[matrix.repository] }}:${{ needs.prepare.outputs.version }}-${{ matrix.platform }}@${{steps.digest.outputs.digest}}
signing-key: ${{ secrets.COSIGN_PRIVATE_KEY }}
signing-password: ${{ secrets.COSIGN_PASSWORD }}
- run: echo "pushing ${{matrix.platform}} to ${{matrix.registry}}/${{matrix.repository}}"

push-rhcc:
name: Push amd64 image to RHCC
Expand All @@ -112,32 +85,7 @@ jobs:
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 }}
- run: echo "noo this should not happen!"

manifest:
name: Create manifest
Expand All @@ -161,24 +109,4 @@ jobs:
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 }}
- run: echo "this should happen again for ${{matrix.registry}}."

0 comments on commit d8dabc7

Please sign in to comment.