-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (80 loc) · 2.39 KB
/
Copy path__deploy.yml
File metadata and controls
86 lines (80 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Deploy 🏗️
on:
workflow_call:
secrets:
JF_BOT_TOKEN:
required: true
CLOUDFLARE_ACCOUNT_ID:
required: true
CLOUDFLARE_API_TOKEN:
required: true
inputs:
branch:
required: true
type: string
commit:
required: false
type: string
comment:
required: false
type: boolean
pr_number:
required: false
type: string
workflow_run_id:
required: true
type: string
artifact_name:
required: false
type: string
default: frontend
jobs:
progress-comment:
name: Progress Comment
if: ${{ always() && inputs.comment }}
uses: ./.github/workflows/__job_messages.yml
secrets:
JF_BOT_TOKEN: ${{ secrets.JF_BOT_TOKEN }}
with:
branch: ${{ inputs.branch }}
commit: ${{ inputs.commit }}
pr_number: ${{ inputs.pr_number }}
comment: true
in_progress: true
cf-pages:
name: CloudFlare Pages 📃
runs-on: ubuntu-latest
environment:
name: ${{ inputs.branch == 'jellyfin/jellyfin-web/master' && 'Production' || 'Preview' }}
url: ${{ steps.cf.outputs.deployment-url }}
outputs:
url: ${{ steps.cf.outputs.deployment-url }}
steps:
- name: Download workflow artifact ⬇️
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ inputs.artifact_name }}
run-id: ${{ inputs.workflow_run_id }}
github-token: ${{ github.token }}
- name: Publish to Cloudflare Pages 📃
uses: cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3.14.1
id: cf
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy . --project-name=jellyfin-web --branch="${{ inputs.branch }}"
compose-comment:
name: Compose and push comment 📝
# Always run so the comment is composed for the workflow summary
if: ${{ always() && inputs.comment }}
uses: ./.github/workflows/__job_messages.yml
secrets: inherit
needs:
- cf-pages
with:
branch: ${{ inputs.branch }}
commit: ${{ inputs.commit }}
preview_url: ${{ needs.cf-pages.outputs.url }}
pr_number: ${{ inputs.pr_number }}
comment: true
in_progress: false