mirror of
https://github.com/jellyfin/jellyfin-vue.git
synced 2024-10-07 03:23:37 +00:00
82886d806e
Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
84 lines
2.7 KiB
YAML
84 lines
2.7 KiB
YAML
name: Deploy 🏗️
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows:
|
|
# Deploy on pull requests
|
|
- Quality checks 👌🧪
|
|
# Deploy on all releases
|
|
- Release 🌍
|
|
types:
|
|
- completed
|
|
|
|
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 ⬇️
|
|
uses: actions/download-artifact@v4.1.7
|
|
with:
|
|
run-id: ${{ github.event.workflow_run.id }}
|
|
github-token: ${{ secrets.JF_BOT_TOKEN }}
|
|
name: frontend
|
|
path: dist
|
|
|
|
- name: Publish to Cloudflare Pages 📃
|
|
uses: cloudflare/pages-action@v1.5.0
|
|
id: cf
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
projectName: jf-vue
|
|
directory: dist
|
|
branch: ${{ env.TARGET_BRANCH }}
|
|
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
compose-comment:
|
|
name: Compose comment 📝
|
|
if: ${{ always() }}
|
|
uses: ./.github/workflows/job_messages.yml
|
|
needs:
|
|
- cf-pages
|
|
|
|
with:
|
|
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 }}
|
|
commenting_workflow_run_id: ${{ github.run_id }}
|
|
in_progress: false
|
|
|
|
comment-status:
|
|
name: Create comment status 📊
|
|
if: ${{ always() && github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.pull_requests[0].number != '' }}
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- compose-comment
|
|
|
|
steps:
|
|
- name: Update job summary in PR comment 🔃
|
|
uses: thollander/actions-comment-pull-request@v2.5.0
|
|
with:
|
|
GITHUB_TOKEN: ${{ secrets.JF_BOT_TOKEN }}
|
|
message: ${{ needs.compose-comment.outputs.msg }}
|
|
pr_number: ${{ github.event.workflow_run.pull_requests[0].number }}
|
|
comment_tag: ${{ needs.compose-comment.outputs.marker }}
|