Skip to content

Commit ed7f348

Browse files
committed
Adding preview with Vercel
1 parent 64ab3b7 commit ed7f348

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
name: Cloudflare Pages
1+
name: Vercel Preview Deployment
22

33
on:
4-
workflow_dispatch:
4+
push:
5+
branches:
6+
- vercel-preview
7+
pr:
8+
type: [opened, synchronize]
59

610
jobs:
711
run:
@@ -11,10 +15,9 @@ jobs:
1115
APP_ENV: prod
1216

1317
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
1821
with:
1922
node-version: 18
2023
cache: "npm"
@@ -32,30 +35,30 @@ jobs:
3235
find ./content/hardware -type f -name "*-pinout.png" -exec cp {} ./static/resources/pinouts/ \;
3336
3437
- name: Gatsby main cache
35-
uses: actions/cache@v3
38+
uses: actions/cache@v4
3639
id: gatsby-cache-folder
3740
with:
3841
path: .cache
39-
key: ${{ runner.os }}-cache-gatsbyV2-${{ github.sha }}
42+
key: ${{ runner.os }}-cache-gatsbyV2-vercel-${{ github.sha }}
4043
restore-keys: |
41-
${{ runner.os }}-cache-gatsbyV2-
44+
${{ runner.os }}-cache-gatsbyV2-vercel-
4245
4346
- name: Gatsby Public Folder
44-
uses: actions/cache@v3
47+
uses: actions/cache@v4
4548
id: gatsby-public-folder
4649
with:
4750
path: public/
48-
key: ${{ runner.os }}-public-gatsbyV2-${{ github.sha }}
51+
key: ${{ runner.os }}-public-gatsbyV2-vercel-${{ github.sha }}
4952
restore-keys: |
50-
${{ runner.os }}-public-gatsbyV2-
53+
${{ runner.os }}-public-gatsbyV2-vercel-
5154
5255
- run: npm install
5356
- run: npm run build
5457

55-
- name: Docs
56-
uses: ./.github/actions/cloudflare-upload
58+
- name: Deploy to Vercel
59+
uses: amondnet/vercel-action@v25
5760
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

Comments
 (0)