-
-
Notifications
You must be signed in to change notification settings - Fork 31
40 lines (33 loc) · 1017 Bytes
/
commit-preview.yaml
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
on: [push]
name: Commit preview
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
name: Generate commit preview
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Enable Corepack shims
run: corepack enable
- name: Install dependencies
run: pnpm install
- name: Build the project
run: pnpm build
- name: Publish to Pages
uses: cloudflare/pages-action@1
id: publish
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: developer-wiki
directory: build
- name: Add a comment on the commit
uses: peter-evans/commit-comment@v1
with:
token: ${{ secrets.COZY_PAT }}
repository: ${{ github.repository }}
sha: ${{ github.sha }}
body: "See preview on Cloudflare Pages: ${{ steps.publish.outputs.url }}"