forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (47 loc) · 1.33 KB
/
deploy_docs.yml
File metadata and controls
54 lines (47 loc) · 1.33 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
name: docs-deploy
on:
pull_request:
paths:
- 'apps/docs/**'
types: [opened, synchronize]
permissions:
contents: read
pull-requests: write
env:
NODE_LTS_VERSION: 20
jobs:
deploy:
name: Deploy docs to Vercel
runs-on: ubuntu-latest
env:
VERCEL_API_TOKEN: ${{ secrets.VERCEL_API_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
fetch-depth: 25
- name: Install Vercel CLI
run: npm i -g vercel@latest
- name: Deploy docs
id: deploy
run: |
URL=$(bash scripts/deploy-docs.sh)
echo "url=$URL" >> $GITHUB_OUTPUT
echo "Deployed to $URL"
env:
DEPLOY_ENVIRONMENT: preview
# - name: Comment on PR with deployment URL
# if: ${{ github.event_name == 'pull_request' }}
# uses: actions/github-script@v7
# with:
# script: |
# const pr = github.context.payload.pull_request?.number
# const url = '${{ steps.deploy.outputs.url }}'
# if (!pr || !url) return
# await github.rest.issues.createComment({
# owner: context.repo.owner,
# repo: context.repo.repo,
# issue_number: pr,
# body: `Docs deployed: ${url}`
# })