mirror of
https://github.com/jellyfin/jellyfin-vue.git
synced 2024-10-07 03:23:37 +00:00
ci(deploy): handle properly master branches from other repositories
Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
parent
94f6c6db70
commit
f0f2c5ccd2
16
.github/workflows/deploy.yml
vendored
16
.github/workflows/deploy.yml
vendored
@ -14,8 +14,20 @@ jobs:
|
||||
cf-pages:
|
||||
name: CloudFlare Pages 📃
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
deployments: write
|
||||
# We set the environment variable here (and as an output) because,
|
||||
# given no real runner is dispatched in compose-comment job (it's dispatched in the reusable workflow) in this workflow definition,
|
||||
# the env. context is not valid.
|
||||
env:
|
||||
TARGET_BRANCH: |
|
||||
github.event.workflow_run.head_repository.full_name == github.repository
|
||||
&& github.event.workflow_run.head_branch
|
||||
|| format('{0}/{1}', github.event.workflow_run.head_repository.full_name, github.event.workflow_run.head_branch)
|
||||
outputs:
|
||||
url: ${{ steps.cf.outputs.url }}
|
||||
branch: ${{ env.TARGET_BRANCH }}
|
||||
|
||||
steps:
|
||||
- name: Download workflow artifact ⬇️
|
||||
@ -34,7 +46,7 @@ jobs:
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
projectName: jf-vue
|
||||
directory: dist
|
||||
branch: ${{ github.event.workflow_run.head_branch }}
|
||||
branch: ${{ env.TARGET_BRANCH }}
|
||||
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
compose-comment:
|
||||
@ -45,7 +57,7 @@ jobs:
|
||||
- cf-pages
|
||||
|
||||
with:
|
||||
branch: ${{ github.event.workflow_run.head_branch }}
|
||||
branch: ${{ needs.cf-pages.outputs.branch }}
|
||||
commit: ${{ github.event.workflow_run.head_commit.id }}
|
||||
preview_url: ${{ needs.cf-pages.outputs.url }}
|
||||
build_workflow_run_id: ${{ github.event.workflow_run.id }}
|
||||
|
Loading…
Reference in New Issue
Block a user