Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/build-container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,15 @@ jobs:
- name: Upload docker image to GHA artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ github.run_id }}
name: ${{ github.run_id }}-image
path: ${{ runner.temp }}/build.tar

# This is stupid, but GHA currently zeros out the pull_requests list in forked repos
# so we have no way to get at this number without going through PRs and matching via hash
- name: Save PR Number to disk
run: echo "${{ github.event.number }}" > pr_number.txt

- uses: actions/upload-artifact@v4
with:
name: ${{ github.run_id }}-number
path: pr_number.txt
14 changes: 13 additions & 1 deletion .github/workflows/pr-build-test-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,21 @@ jobs:
- name: Upload build to GHA
uses: actions/upload-artifact@v4
with:
name: ${{ github.run_id }}
name: ${{ github.run_id }}-build
path: ${{ runner.temp }}/build.tar

# This is stupid, but GHA currently zeros out the pull_requests list in forked repos
# so we have no way to get at this number without going through PRs and matching via hash
- name: Save PR Number to disk
if: github.event.workflow_run.event == 'pull_request'
run: echo "${{ github.event.number }}" > pr_number.txt

- uses: actions/upload-artifact@v4
if: github.event.workflow_run.event == 'pull_request'
with:
name: ${{ github.run_id }}-number
path: pr_number.txt


check-no-modified-translations:
name: Translations only via Crowdin
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/pr-deploy-container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Download docker image from GHA
uses: actions/download-artifact@v4
with:
name: ${{ github.event.workflow_run.id }}
name: ${{ github.event.workflow_run.id }}-image
path: ${{ runner.temp }}
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
Expand All @@ -34,9 +34,20 @@ jobs:
run: |
docker load --input ${{ runner.temp }}/build.tar

- name: Push main branch image
- name: Fetch pr number from GHA
uses: actions/download-artifact@v4
with:
name: ${{ github.event.workflow_run.id }}-number
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}

- name: Read PR Number
run: |
echo "PR_NUMBER=$(cat pr_number.txt)" >> $GITHUB_ENV

- name: Push PR image
run: |
docker push ghcr.io/${{ github.repository_owner }}/admin-interface:pr-${{ github.event.workflow_run.pull_requests[0].number }}
docker push ghcr.io/${{ github.repository_owner }}/admin-interface:pr-${{ env.PR_NUMBER }}

- name: Add comment
uses: thollander/actions-comment-pull-request@v3
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/pr-deploy-test-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ concurrency:
jobs:
deploy-pr:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Prepare git
run: |
Expand Down Expand Up @@ -42,11 +43,22 @@ jobs:
- name: Fetch build from GHA
uses: actions/download-artifact@v4
with:
name: ${{ github.event.workflow_run.id }}
name: ${{ github.event.workflow_run.id }}-build
path: ${{ runner.temp }}/
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}

- name: Fetch pr number from GHA
uses: actions/download-artifact@v4
with:
name: ${{ github.event.workflow_run.id }}-number
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}

- name: Read PR Number
run: |
echo "PR_NUMBER=$(cat pr_number.txt)" >> $GITHUB_ENV

- name: Store build in the clone
run: |
tar xf ${{ runner.temp }}/build.tar
Expand Down Expand Up @@ -84,7 +96,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 }}
pr-number: ${{ env.PR_NUMBER }}
comment-tag: static-test-deployment
message: >
This pull request is deployed at
Expand Down
Loading