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