-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (37 loc) · 1.22 KB
/
build-docs.yml
File metadata and controls
49 lines (37 loc) · 1.22 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
name: Build Docs
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Export secrets
run: |
echo "VITE_EMAILJS_SERVICE_ID=${{ secrets.VITE_EMAILJS_SERVICE_ID }}" >> $GITHUB_ENV
echo "VITE_EMAILJS_TEMPLATE_ID=${{ secrets.VITE_EMAILJS_TEMPLATE_ID }}" >> $GITHUB_ENV
echo "VITE_EMAILJS_PUBLIC_KEY=${{ secrets.VITE_EMAILJS_PUBLIC_KEY }}" >> $GITHUB_ENV
echo "VITE_GITHUB_TOKEN=${{ secrets.VITE_GITHUB_TOKEN }}" >> $GITHUB_ENV
echo "VITE_GITHUB_USERNAME=${{ secrets.VITE_GITHUB_USERNAME }}" >> $GITHUB_ENV
- name: Build project
run: npm run build
- name: Commit docs folder
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add docs
git diff --cached --quiet && exit 0
git commit -m "Auto-build docs"
git push