mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #5470 from thornbill/master
Fix branch ref in publish action
This commit is contained in:
commit
bda08b284e
2 changed files with 9 additions and 2 deletions
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
|
@ -57,9 +57,11 @@ jobs:
|
|||
steps:
|
||||
- name: Save PR context
|
||||
env:
|
||||
PR_BRANCH: ${{ github.ref_name }}
|
||||
PR_NUMBER: ${{ github.event.number }}
|
||||
PR_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
run: |
|
||||
echo $PR_BRANCH > PR_branch
|
||||
echo $PR_NUMBER > PR_number
|
||||
echo $PR_SHA > PR_sha
|
||||
|
||||
|
@ -68,5 +70,6 @@ jobs:
|
|||
with:
|
||||
name: PR_context
|
||||
path: |
|
||||
PR_branch
|
||||
PR_number
|
||||
PR_sha
|
||||
|
|
8
.github/workflows/publish.yml
vendored
8
.github/workflows/publish.yml
vendored
|
@ -15,6 +15,8 @@ jobs:
|
|||
|
||||
name: Deploy to Cloudflare Pages
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- pr-context
|
||||
outputs:
|
||||
url: ${{ steps.cf.outputs.url }}
|
||||
|
||||
|
@ -33,7 +35,7 @@ jobs:
|
|||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
projectName: jellyfin-web
|
||||
branch: ${{ github.event.workflow_run.head_branch }}
|
||||
branch: ${{ needs.pr-context.outputs.branch }}
|
||||
directory: dist
|
||||
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
@ -42,6 +44,7 @@ jobs:
|
|||
if: ${{ always() && github.event.workflow_run.event == 'pull_request' }}
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
branch: ${{ env.pr_branch }}
|
||||
commit: ${{ env.pr_sha }}
|
||||
pr_number: ${{ env.pr_number }}
|
||||
|
||||
|
@ -56,6 +59,7 @@ jobs:
|
|||
- name: Set PR context environment variables
|
||||
if: ${{ steps.pr_context.conclusion == 'success' }}
|
||||
run: |
|
||||
echo "pr_branch=$(cat PR_branch)" >> $GITHUB_ENV
|
||||
echo "pr_number=$(cat PR_number)" >> $GITHUB_ENV
|
||||
echo "pr_sha=$(cat PR_sha)" >> $GITHUB_ENV
|
||||
|
||||
|
@ -68,7 +72,7 @@ jobs:
|
|||
- pr-context
|
||||
|
||||
with:
|
||||
branch: ${{ github.event.workflow_run.head_branch }}
|
||||
branch: ${{ needs.pr-context.outputs.branch }}
|
||||
commit: ${{ needs.pr-context.outputs.commit != '' && needs.pr-context.outputs.commit || github.event.workflow_run.head_sha }}
|
||||
preview_url: ${{ needs.publish.outputs.url }}
|
||||
build_workflow_run_id: ${{ github.event.workflow_run.id }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue