Skip to content

Commit b8b93e6

Browse files
committed
ci: docs previews in pr
1 parent f5c494c commit b8b93e6

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/docs-prs.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# From https://github.com/marketplace/actions/deploy-to-firebase-hosting
2+
3+
name: Deploy Docs Preview on PR
4+
5+
on:
6+
pull_request:
7+
paths:
8+
- 'docs/**'
9+
- 'src/**' # for api changes
10+
- '.github/workflows/docs.yml'
11+
12+
jobs:
13+
build_and_preview:
14+
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Install Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 16
23+
24+
- uses: pnpm/action-setup@v2
25+
name: Install pnpm
26+
id: pnpm-install
27+
with:
28+
version: 7
29+
run_install: false
30+
31+
- name: Get pnpm store directory
32+
id: pnpm-cache
33+
shell: bash
34+
run: |
35+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
36+
37+
- uses: actions/cache@v3
38+
name: Setup pnpm cache
39+
with:
40+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
41+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
42+
restore-keys: |
43+
${{ runner.os }}-pnpm-store-
44+
45+
- name: Install dependencies
46+
run: pnpm install
47+
48+
- name: Build docs
49+
run: pnpm run docs:build
50+
51+
- uses: FirebaseExtended/action-hosting-deploy@v0
52+
with:
53+
repoToken: '${{ secrets.GITHUB_TOKEN }}'
54+
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_VUEFIREDOCS }}'
55+
projectId: vuefiredocs

0 commit comments

Comments
 (0)