From 15197503026a489f9a6759cc850bb1a029af7799 Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Wed, 24 Jun 2026 15:09:32 -0600 Subject: [PATCH 01/11] This workflow is always running (for both PRs, and normal builds), so we rename it to be more generic. --- .../{pr-build-container-image.yml => build-container-image.yml} | 2 +- .github/workflows/pr-deploy-container-image.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{pr-build-container-image.yml => build-container-image.yml} (96%) diff --git a/.github/workflows/pr-build-container-image.yml b/.github/workflows/build-container-image.yml similarity index 96% rename from .github/workflows/pr-build-container-image.yml rename to .github/workflows/build-container-image.yml index f9ec8a1d81..636f80621d 100644 --- a/.github/workflows/pr-build-container-image.yml +++ b/.github/workflows/build-container-image.yml @@ -1,4 +1,4 @@ -name: PRs » Build container image +name: Build » Container image on: push: diff --git a/.github/workflows/pr-deploy-container-image.yml b/.github/workflows/pr-deploy-container-image.yml index d8cdb016fb..b7b5886ef8 100644 --- a/.github/workflows/pr-deploy-container-image.yml +++ b/.github/workflows/pr-deploy-container-image.yml @@ -2,7 +2,7 @@ name: PRs » Push container image on: workflow_run: - workflows: ["PRs » Build container image"] + workflows: ["Build » Container image"] types: - completed From a63238bf6eef3974572727291079ca99380e481d Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Wed, 24 Jun 2026 15:10:23 -0600 Subject: [PATCH 02/11] Correcting the docker tag name being pushed, and passing the required github token to fetch the artifacts across job/workflow boundaries. --- .github/workflows/pr-deploy-container-image.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-deploy-container-image.yml b/.github/workflows/pr-deploy-container-image.yml index b7b5886ef8..60932810fc 100644 --- a/.github/workflows/pr-deploy-container-image.yml +++ b/.github/workflows/pr-deploy-container-image.yml @@ -32,12 +32,13 @@ jobs: with: name: build path: ${{ runner.temp }} + github-token: ${{ github.token }} run-id: ${{ github.event.workflow_run.id }} - name: Load image run: | docker load --input ${{ runner.temp }}/build.tar - docker push ghcr.io/${{ github.repository }} + docker push ${{ steps.meta.outputs.tags }} - name: Add comment if: github.event_name == 'pull_request' From 62cb05b015d03a8b07953d66a946ed3256cc0a18 Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Wed, 24 Jun 2026 15:11:09 -0600 Subject: [PATCH 03/11] Similar to the docker side of things, we need the token to pass things between jobs. Also corrects the path in the artifact download. --- .github/workflows/pr-deploy-test-branch.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-deploy-test-branch.yml b/.github/workflows/pr-deploy-test-branch.yml index 6da7d97bde..9682de1aab 100644 --- a/.github/workflows/pr-deploy-test-branch.yml +++ b/.github/workflows/pr-deploy-test-branch.yml @@ -43,7 +43,8 @@ jobs: uses: actions/download-artifact@v4 with: name: build - path: ${{ runner.temp }}/build.tar + path: ${{ runner.temp }}/ + github-token: ${{ github.token }} run-id: ${{ github.event.workflow_run.id }} - name: Store build in the clone From 04abbeaff00e8a576ceda4663992e45880236d10 Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Wed, 24 Jun 2026 15:11:37 -0600 Subject: [PATCH 04/11] Since we're in a different context, we need to explicitly set the pr-number involved here. This is the originating PR. --- .github/workflows/pr-deploy-container-image.yml | 1 + .github/workflows/pr-deploy-test-branch.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/pr-deploy-container-image.yml b/.github/workflows/pr-deploy-container-image.yml index 60932810fc..0a7895b34f 100644 --- a/.github/workflows/pr-deploy-container-image.yml +++ b/.github/workflows/pr-deploy-container-image.yml @@ -44,6 +44,7 @@ jobs: if: github.event_name == 'pull_request' uses: thollander/actions-comment-pull-request@v3 with: + pr-number: ${{ github.event.workflow_run.pull_requests[0].number }} comment-tag: container-image message: | Use `docker` or `podman` to test this pull request locally. diff --git a/.github/workflows/pr-deploy-test-branch.yml b/.github/workflows/pr-deploy-test-branch.yml index 9682de1aab..d9f9858ff7 100644 --- a/.github/workflows/pr-deploy-test-branch.yml +++ b/.github/workflows/pr-deploy-test-branch.yml @@ -84,6 +84,7 @@ jobs: - name: Add comment with deployment location uses: thollander/actions-comment-pull-request@v3 with: + pr-number: ${{ github.event.workflow_run.pull_requests[0].number }} comment-tag: static-test-deployment message: > This pull request is deployed at From f28d314a12ddd7263dc043e001f219a2d5121d87 Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Tue, 7 Jul 2026 13:11:40 -0600 Subject: [PATCH 05/11] Cleaning up the step descriptions --- .github/workflows/build-container-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-container-image.yml b/.github/workflows/build-container-image.yml index 636f80621d..6cfa3f63a3 100644 --- a/.github/workflows/build-container-image.yml +++ b/.github/workflows/build-container-image.yml @@ -22,7 +22,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Build and push images + - name: Build image uses: docker/build-push-action@v6 with: push: false # This is handled in another workflow! @@ -30,7 +30,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} outputs: type=docker,dest=${{ runner.temp }}/build.tar - - name: Upload docker image to GHA + - name: Upload docker image to GHA artifacts uses: actions/upload-artifact@v4 with: name: build From 132b074a3b6633ea18c8c304917ac91a42c996a3 Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Tue, 7 Jul 2026 13:12:12 -0600 Subject: [PATCH 06/11] This can get run in not-opencast setups (ie, my test setup), so we need to make the org name a template --- .github/workflows/pr-remove-test-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-remove-test-branch.yml b/.github/workflows/pr-remove-test-branch.yml index 98ea7d6566..cbc647482c 100644 --- a/.github/workflows/pr-remove-test-branch.yml +++ b/.github/workflows/pr-remove-test-branch.yml @@ -32,7 +32,7 @@ jobs: - name: Clone test repository run: | - git clone -b gh-pages "git@github.com:opencast/admin-interface-test.git" admin-interface-test + git clone -b gh-pages "git@github.com:${{ github.repository_owner }}/admin-interface-test.git" admin-interface-test - name: Delete build if present working-directory: admin-interface-test From e401e624124db37495d9e58e15553e4aeb2b20a5 Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Tue, 7 Jul 2026 13:14:57 -0600 Subject: [PATCH 07/11] We're only doing this on PRs, so the whole workflow needs to be fused off --- .github/workflows/pr-deploy-container-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-deploy-container-image.yml b/.github/workflows/pr-deploy-container-image.yml index 0a7895b34f..3d154970bc 100644 --- a/.github/workflows/pr-deploy-container-image.yml +++ b/.github/workflows/pr-deploy-container-image.yml @@ -13,6 +13,7 @@ jobs: contents: read packages: write pull-requests: write + if: github.event.workflow_run.event == 'pull_request' steps: - name: Log in to the container registry uses: docker/login-action@v3 @@ -41,7 +42,6 @@ jobs: docker push ${{ steps.meta.outputs.tags }} - name: Add comment - if: github.event_name == 'pull_request' uses: thollander/actions-comment-pull-request@v3 with: pr-number: ${{ github.event.workflow_run.pull_requests[0].number }} From 1cf61f3eec7bbc29df60b9ddb6c4929aed22f0a6 Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Tue, 7 Jul 2026 13:16:02 -0600 Subject: [PATCH 08/11] Split load and push into separate steps so that it's much clearer if half of it fails --- .github/workflows/pr-deploy-container-image.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-deploy-container-image.yml b/.github/workflows/pr-deploy-container-image.yml index 3d154970bc..922fc76806 100644 --- a/.github/workflows/pr-deploy-container-image.yml +++ b/.github/workflows/pr-deploy-container-image.yml @@ -39,7 +39,10 @@ jobs: - name: Load image run: | docker load --input ${{ runner.temp }}/build.tar - docker push ${{ steps.meta.outputs.tags }} + + - name: Push main branch image + run: | + docker push ghcr.io/${{ github.repository_owner }}/admin-interface:pr-${{ github.event.workflow_run.pull_requests[0].number }} - name: Add comment uses: thollander/actions-comment-pull-request@v3 From de12cf175e30a5ebed7d837e2616af1efe22ac48 Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Tue, 7 Jul 2026 13:16:23 -0600 Subject: [PATCH 09/11] We don't need/want this here --- .github/workflows/pr-deploy-container-image.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/pr-deploy-container-image.yml b/.github/workflows/pr-deploy-container-image.yml index 922fc76806..416541c8f0 100644 --- a/.github/workflows/pr-deploy-container-image.yml +++ b/.github/workflows/pr-deploy-container-image.yml @@ -22,12 +22,6 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Extract metadata (tags, labels) - id: meta - uses: docker/metadata-action@v5 - with: - images: ghcr.io/${{ github.repository }} - - name: Download docker image from GHA uses: actions/download-artifact@v4 with: From 50ddb40be3c14f8dd998a3732a8eacc2ee857d76 Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Tue, 7 Jul 2026 13:35:16 -0600 Subject: [PATCH 10/11] Using workflow run id as the key, rather than build, when deploying and fetching artifacts from GH --- .github/workflows/build-container-image.yml | 2 +- .github/workflows/pr-build-test-branch.yml | 2 +- .github/workflows/pr-deploy-container-image.yml | 2 +- .github/workflows/pr-deploy-test-branch.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-container-image.yml b/.github/workflows/build-container-image.yml index 6cfa3f63a3..431d4d0a6a 100644 --- a/.github/workflows/build-container-image.yml +++ b/.github/workflows/build-container-image.yml @@ -33,5 +33,5 @@ jobs: - name: Upload docker image to GHA artifacts uses: actions/upload-artifact@v4 with: - name: build + name: ${{ github.run_id }} path: ${{ runner.temp }}/build.tar diff --git a/.github/workflows/pr-build-test-branch.yml b/.github/workflows/pr-build-test-branch.yml index 9934e29777..2c0cd2fe8a 100644 --- a/.github/workflows/pr-build-test-branch.yml +++ b/.github/workflows/pr-build-test-branch.yml @@ -66,7 +66,7 @@ jobs: - name: Upload build to GHA uses: actions/upload-artifact@v4 with: - name: build + name: ${{ github.run_id }} path: ${{ runner.temp }}/build.tar diff --git a/.github/workflows/pr-deploy-container-image.yml b/.github/workflows/pr-deploy-container-image.yml index 416541c8f0..1b2c3af5da 100644 --- a/.github/workflows/pr-deploy-container-image.yml +++ b/.github/workflows/pr-deploy-container-image.yml @@ -25,7 +25,7 @@ jobs: - name: Download docker image from GHA uses: actions/download-artifact@v4 with: - name: build + name: ${{ github.event.workflow_run.id }} path: ${{ runner.temp }} github-token: ${{ github.token }} run-id: ${{ github.event.workflow_run.id }} diff --git a/.github/workflows/pr-deploy-test-branch.yml b/.github/workflows/pr-deploy-test-branch.yml index d9f9858ff7..6c12143aa0 100644 --- a/.github/workflows/pr-deploy-test-branch.yml +++ b/.github/workflows/pr-deploy-test-branch.yml @@ -42,7 +42,7 @@ jobs: - name: Fetch build from GHA uses: actions/download-artifact@v4 with: - name: build + name: ${{ github.event.workflow_run.id }} path: ${{ runner.temp }}/ github-token: ${{ github.token }} run-id: ${{ github.event.workflow_run.id }} From 416a62985a178a4d5fe8e8e52bdb9567c492e007 Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Tue, 7 Jul 2026 13:35:30 -0600 Subject: [PATCH 11/11] Fixing incorrect commit message template --- .github/workflows/pr-deploy-test-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-deploy-test-branch.yml b/.github/workflows/pr-deploy-test-branch.yml index 6c12143aa0..98a2ac3979 100644 --- a/.github/workflows/pr-deploy-test-branch.yml +++ b/.github/workflows/pr-deploy-test-branch.yml @@ -74,7 +74,7 @@ jobs: working-directory: admin-interface-test run: | git add . - git commit --amend -m "Build ${{ steps.build-path.outputs.build }}" + git commit --amend -m "Build ${{ github.event.workflow_run.pull_requests[0].number }}" - name: Force push admin interface test branch working-directory: admin-interface-test