mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #5471 from thornbill/master
Fix publish workflow for non-prs
This commit is contained in:
commit
f2a6ac3946
1 changed files with 26 additions and 25 deletions
51
.github/workflows/publish.yml
vendored
51
.github/workflows/publish.yml
vendored
|
@ -8,12 +8,37 @@ on:
|
|||
- completed
|
||||
|
||||
jobs:
|
||||
pr-context:
|
||||
name: PR context
|
||||
if: ${{ 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 }}
|
||||
|
||||
steps:
|
||||
- name: Get PR context
|
||||
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe # v3.1.4
|
||||
id: pr_context
|
||||
with:
|
||||
run_id: ${{ github.event.workflow_run.id }}
|
||||
name: PR_context
|
||||
|
||||
- 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
|
||||
|
||||
publish:
|
||||
permissions:
|
||||
contents: read
|
||||
deployments: write
|
||||
|
||||
name: Deploy to Cloudflare Pages
|
||||
if: ${{ always() }}
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- pr-context
|
||||
|
@ -35,34 +60,10 @@ jobs:
|
|||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
projectName: jellyfin-web
|
||||
branch: ${{ needs.pr-context.outputs.branch }}
|
||||
branch: ${{ needs.pr-context.outputs.branch || github.ref_name }}
|
||||
directory: dist
|
||||
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
pr-context:
|
||||
name: PR context
|
||||
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 }}
|
||||
|
||||
steps:
|
||||
- name: Get PR context
|
||||
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe # v3.1.4
|
||||
id: pr_context
|
||||
with:
|
||||
run_id: ${{ github.event.workflow_run.id }}
|
||||
name: PR_context
|
||||
|
||||
- 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
|
||||
|
||||
compose-comment:
|
||||
name: Compose comment
|
||||
if: ${{ always() }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue