56 lines
1.5 KiB
YAML
56 lines
1.5 KiB
YAML
name: Publish PR builds
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ["build-ublue"]
|
|
types:
|
|
- completed
|
|
|
|
env:
|
|
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
|
|
|
|
|
|
jobs:
|
|
upload:
|
|
runs-on: ubuntu-latest
|
|
if: >
|
|
github.event.workflow_run.event == 'pull_request' &&
|
|
github.event.workflow_run.conclusion == 'success'
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: output
|
|
|
|
- name: Load Container Image
|
|
id: load_image
|
|
run: |
|
|
ls -lah
|
|
cat image
|
|
cat tags
|
|
podman load -i image.tar
|
|
echo image="$(cat image)" >> $GITHUB_OUTPUT
|
|
echo tags="$(cat tags)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Lowercase Registry
|
|
id: registry_case
|
|
uses: ASzc/change-string-case-action@v5
|
|
with:
|
|
string: ${{ env.IMAGE_REGISTRY }}
|
|
|
|
- name: Push To GHCR
|
|
uses: redhat-actions/push-to-registry@v2
|
|
id: push
|
|
if: github.event_name != 'pull_request'
|
|
env:
|
|
REGISTRY_USER: ${{ github.actor }}
|
|
REGISTRY_PASSWORD: ${{ github.token }}
|
|
with:
|
|
image: ${{ steps.load_image.outputs.image }}
|
|
tags: ${{ steps.load_image.outputs.tags }}
|
|
registry: ${{ steps.registry_case.outputs.lowercase }}
|
|
username: ${{ env.REGISTRY_USER }}
|
|
password: ${{ env.REGISTRY_PASSWORD }}
|
|
extra-args: |
|
|
--disable-content-trust
|
|
|