1
- name : Cloudflare Pages
1
+ name : Vercel Preview Deployment
2
2
3
3
on :
4
- workflow_dispatch :
4
+ push :
5
+ branches :
6
+ - vercel-preview
7
+ pr :
8
+ type : [opened, synchronize]
5
9
6
10
jobs :
7
11
run :
11
15
APP_ENV : prod
12
16
13
17
steps :
14
- - uses : actions/checkout@v3
15
- with :
16
- fetch-depth : 0
17
- - uses : actions/setup-node@v3
18
+ - uses : actions/checkout@v4
19
+
20
+ - uses : actions/setup-node@v4
18
21
with :
19
22
node-version : 18
20
23
cache : " npm"
@@ -32,30 +35,30 @@ jobs:
32
35
find ./content/hardware -type f -name "*-pinout.png" -exec cp {} ./static/resources/pinouts/ \;
33
36
34
37
- name : Gatsby main cache
35
- uses : actions/cache@v3
38
+ uses : actions/cache@v4
36
39
id : gatsby-cache-folder
37
40
with :
38
41
path : .cache
39
- key : ${{ runner.os }}-cache-gatsbyV2-${{ github.sha }}
42
+ key : ${{ runner.os }}-cache-gatsbyV2-vercel- ${{ github.sha }}
40
43
restore-keys : |
41
- ${{ runner.os }}-cache-gatsbyV2-
44
+ ${{ runner.os }}-cache-gatsbyV2-vercel-
42
45
43
46
- name : Gatsby Public Folder
44
- uses : actions/cache@v3
47
+ uses : actions/cache@v4
45
48
id : gatsby-public-folder
46
49
with :
47
50
path : public/
48
- key : ${{ runner.os }}-public-gatsbyV2-${{ github.sha }}
51
+ key : ${{ runner.os }}-public-gatsbyV2-vercel- ${{ github.sha }}
49
52
restore-keys : |
50
- ${{ runner.os }}-public-gatsbyV2-
53
+ ${{ runner.os }}-public-gatsbyV2-vercel-
51
54
52
55
- run : npm install
53
56
- run : npm run build
54
57
55
- - name : Docs
56
- uses : ./.github/actions/cloudflare-upload
58
+ - name : Deploy to Vercel
59
+ uses : amondnet/vercel-action@v25
57
60
with :
58
- upload-dir : public
59
- project-name : docs-content
60
- cloudflare-api-token : ${{ secrets.CLOUDFLARE_API_TOKEN }}
61
- cloudflare-account : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
61
+ vercel-token : ${{ secrets.VERCEL_TOKEN }}
62
+ vercel-org-id : ${{ secrets.VERCEL_ORG_ID}}
63
+ vercel-project-id : ${{ secrets.VERCEL_PROJECT_ID }}
64
+ working-directory : ./public
0 commit comments