Skip to content

Commit cb6b107

Browse files
authored
feat: Add GitHub Actions workflow for Netlify preview deployments (#667)
* feat: Add GitHub Actions workflow for Netlify preview deployments * chore: Disable GitHub deployment status for cleaner PR UI * chore: Add deploy preview alias for readable preview URLs * chore: Disable GitHub Actions bot comment to avoid duplication * chore: Re-enable GitHub Actions bot comment for preview URL
1 parent 1e54c05 commit cb6b107

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/preview-docs.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Preview Documentation
19+
20+
on:
21+
pull_request:
22+
paths:
23+
- 'website/**'
24+
25+
jobs:
26+
deploy-preview:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- uses: pnpm/action-setup@v4
32+
with:
33+
version: 8
34+
run_install: false
35+
36+
- uses: actions/setup-node@v4
37+
with:
38+
node-version: "20"
39+
40+
- name: Corepack
41+
working-directory: website
42+
run: npm i -g --force corepack && corepack enable
43+
44+
- name: Install Dependencies
45+
working-directory: website
46+
run: pnpm install
47+
48+
- name: Build
49+
working-directory: website
50+
run: pnpm build
51+
52+
- name: Deploy to Netlify
53+
uses: nwtgck/[email protected]
54+
with:
55+
publish-dir: './website/build'
56+
production-deploy: false
57+
github-token: ${{ secrets.GITHUB_TOKEN }}
58+
deploy-message: ${{ github.event.pull_request.title }}
59+
enable-pull-request-comment: true
60+
enable-commit-comment: false
61+
enable-github-deployment: false
62+
alias: deploy-preview-${{ github.event.number }}
63+
env:
64+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
65+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

0 commit comments

Comments
 (0)