Skip to content

Commit

Permalink
chore: push mapt pr images to ghcr registry
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Riobo <ariobolo@redhat.com>
  • Loading branch information
adrianriobo committed Oct 11, 2024
1 parent 6968cee commit 6320ce9
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build-oci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ jobs:
run: |
IMG=ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }} make oci-build
podman save -o mapt.tar ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }}
echo "ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }}" > mapt-image
- name: Save image for PR
uses: actions/upload-artifact@v4
with:
name: mapt-pr-${{ github.event.number }}
path: mapt.tar
name: mapt
path: mapt*

- name: Build image
if: ${{ github.event_name != 'pull_request' }}
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/push-oci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: oci-push

on:
workflow_run:
workflows:
- oci-builds
types:
- completed

jobs:
push:
name: push
if: |
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'pull_request'
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
steps:
- name: Download mapt assets
uses: actions/download-artifact@v4
with:
name: mapt
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ github.token }}

- name: Log in to ghcr.io
uses: redhat-actions/podman-login@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push mapt
run: |
podman load -i mapt.tar
podman push $(cat mapt-image)

0 comments on commit 6320ce9

Please sign in to comment.