-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #521 from securesign/tturek/gh-artifact-oci
github-action: Store OCI image as artifact
- Loading branch information
Showing
1 changed file
with
94 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ env: | |
IMG: ttl.sh/securesign/secure-sign-operator-${{github.run_number}}:1h | ||
BUNDLE_IMG: ttl.sh/securesign/bundle-secure-sign-${{github.run_number}}:1h | ||
CATALOG_IMG: ttl.sh/securesign/catalog-${{github.run_number}}:1h | ||
CONTAINER_TOOL: podman | ||
|
||
jobs: | ||
build-operator: | ||
|
@@ -32,6 +33,16 @@ jobs: | |
- name: Build operator container | ||
run: make docker-build docker-push | ||
|
||
- name: Save container image | ||
run: podman save -o /tmp/operator-oci.tar --format oci-archive $IMG | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: operator-image | ||
path: /tmp/operator-oci.tar | ||
retention-days: 1 | ||
|
||
build-bundle: | ||
name: Build-bundle-image | ||
runs-on: ubuntu-20.04 | ||
|
@@ -45,6 +56,16 @@ jobs: | |
- name: Build operator bundle | ||
run: make bundle bundle-build bundle-push | ||
|
||
- name: Save container image | ||
run: podman save -o /tmp/bundle-oci.tar --format oci-archive $BUNDLE_IMG | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bundle-image | ||
path: /tmp/bundle-oci.tar | ||
retention-days: 1 | ||
|
||
build-fbc: | ||
name: Build-fbc | ||
runs-on: ubuntu-20.04 | ||
|
@@ -54,13 +75,23 @@ jobs: | |
uses: actions/checkout@v4 | ||
|
||
- name: Log in to registry.redhat.io | ||
uses: redhat-actions/podman-login@9184318aae1ee5034fbfbacc0388acf12669171f # v1 | ||
uses: redhat-actions/podman-login@v1 | ||
with: | ||
username: ${{ secrets.REGISTRY_USER }} | ||
password: ${{ secrets.REGISTRY_PASSWORD }} | ||
registry: registry.redhat.io | ||
auth_file_path: /tmp/config.json | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: "*-image" | ||
merge-multiple: true | ||
path: /tmp | ||
|
||
- name: Load images | ||
run: podman load -i /tmp/bundle-oci.tar | ||
|
||
- name: Install OPM | ||
run: | | ||
make opm | ||
|
@@ -87,8 +118,19 @@ jobs: | |
cat v4.14/graph.json | ||
${{ env.OPM }} alpha render-template basic v4.14/graph.json > v4.14/catalog/rhtas-operator/catalog.json | ||
${{ env.OPM }} validate v4.14/catalog/rhtas-operator | ||
docker build v4.14 -f v4.14/catalog.Dockerfile -t $CATALOG_IMG | ||
docker push $CATALOG_IMG | ||
podman build v4.14 -f v4.14/catalog.Dockerfile -t $CATALOG_IMG | ||
podman push $CATALOG_IMG | ||
- name: Save container image | ||
run: podman save -o /tmp/catalog-oci.tar --format oci-archive $CATALOG_IMG | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: catalog-image | ||
path: /tmp/catalog-oci.tar | ||
retention-days: 1 | ||
|
||
build-tuftool: | ||
name: Build-tuftool | ||
runs-on: ubuntu-20.04 | ||
|
@@ -136,13 +178,23 @@ jobs: | |
- run: echo "/tmp/tuftool" >> $GITHUB_PATH | ||
|
||
- name: Log in to registry.redhat.io | ||
uses: redhat-actions/podman-login@9184318aae1ee5034fbfbacc0388acf12669171f # v1 | ||
uses: redhat-actions/podman-login@v1 | ||
with: | ||
username: ${{ secrets.REGISTRY_USER }} | ||
password: ${{ secrets.REGISTRY_PASSWORD }} | ||
registry: registry.redhat.io | ||
auth_file_path: /tmp/config.json | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: "*-image" | ||
merge-multiple: true | ||
path: /tmp | ||
|
||
- name: Load images | ||
run: podman load -i /tmp/operator-oci.tar | ||
|
||
- name: Install Cluster | ||
uses: container-tools/[email protected] | ||
with: | ||
|
@@ -261,15 +313,25 @@ jobs: | |
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Log in to registry.redhat.io | ||
uses: redhat-actions/podman-login@9184318aae1ee5034fbfbacc0388acf12669171f # v1 | ||
uses: redhat-actions/podman-login@v1 | ||
with: | ||
username: ${{ secrets.REGISTRY_USER }} | ||
password: ${{ secrets.REGISTRY_PASSWORD }} | ||
registry: registry.redhat.io | ||
auth_file_path: /tmp/config.json | ||
|
||
- name: Image prune | ||
run: docker image prune -af | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: "*-image" | ||
merge-multiple: true | ||
path: /tmp | ||
|
||
- name: Load images | ||
run: | | ||
podman load -i /tmp/operator-oci.tar | ||
podman load -i /tmp/bundle-oci.tar | ||
podman load -i /tmp/catalog-oci.tar | ||
- name: Install Cluster | ||
uses: container-tools/[email protected] | ||
|
@@ -383,7 +445,17 @@ jobs: | |
auth_file_path: /tmp/config.json | ||
|
||
- name: Image prune | ||
run: docker image prune -af | ||
run: podman image prune -af | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: "*-image" | ||
merge-multiple: true | ||
path: /tmp | ||
|
||
- name: Load images | ||
run: podman load -i /tmp/operator-oci.tar | ||
|
||
- name: Install Cluster | ||
uses: container-tools/[email protected] | ||
|
@@ -466,13 +538,26 @@ jobs: | |
kubectl patch storageclass gp2 -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' | ||
- name: Log in to registry.redhat.io | ||
uses: redhat-actions/podman-login@9184318aae1ee5034fbfbacc0388acf12669171f # v1 | ||
uses: redhat-actions/podman-login@v1 | ||
with: | ||
username: ${{ secrets.REGISTRY_USER }} | ||
password: ${{ secrets.REGISTRY_PASSWORD }} | ||
registry: registry.redhat.io | ||
auth_file_path: /tmp/config.json | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: "*-image" | ||
merge-multiple: true | ||
path: /tmp | ||
|
||
- name: Load images | ||
run: podman load -i /tmp/operator-oci.tar | ||
|
||
- name: Push images | ||
run: podman push $IMG | ||
|
||
- name: Create namespace and serviceaccounts with redhat registry login | ||
run: | | ||
kubectl create ns ${{ env.TEST_NAMESPACE }} | ||
|