This repository has been archived by the owner on Jul 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
55 lines (48 loc) · 1.72 KB
/
deploy-cf-pages.yml
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
name: deploy-cf-pages
on:
workflow_call:
secrets:
CLOUDFLARE_ACCOUNT_ID:
required: true
CLOUDFLARE_TOKEN:
required: true
jobs:
prod:
# if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
permissions:
contents: read
id-token: write
pull-requests: write
checks: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Restore built website
uses: actions/cache@v4
with:
path: dist
key: >
website
${{ github.run_id }}
${{ github.run_attempt }}
fail-on-cache-miss: true
- name: Publish to Cloudflare Pages
id: cloudflare-pages-deploy
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CLOUDFLARE_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: jupyter-flex-danielfrg-com
directory: dist
- name: Comment deploy url
uses: mshick/add-pr-comment@v2
with:
message-id: cloudflare-deploy
message: |
### <span aria-hidden="true">✅</span> Preview deployment
| Name | Link |
|---------------------------------|------------------------|
| Deploy Preview Url | [${{ steps.cloudflare-pages-deploy.outputs.url }}](${{ steps.cloudflare-pages-deploy.outputs.url }}) |
| Latest deploy log | ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
| Latest commit | ${{ github.sha }} |
| Environment | ${{ steps.cloudflare-pages-deploy.outputs.environment }} |