-
Notifications
You must be signed in to change notification settings - Fork 9
51 lines (41 loc) · 1.39 KB
/
docs.yml
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
name: Deploy Documentation To GitHub Pages
# v1.0.0
#
# About this workflow:
# This workflow runs `npm run build` and then syncs the `build` folder to GitHub Pages.
# GitHub repo configuration:
# 1. Go to Manage access and add 'Github Actions' team with role: admin.
# 2. If you have protected branches, go to Branches > edit protected branch > enable 'Restrict who can push to
# matching branches' and add the 'athombv/github-actions' team.
# Required secrets:
# - HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN: required for publishing to the gh-pages branch.
# Note: make sure to commit package-lock.json, this is needed for `npm ci`.
# Note: add `.github` to .npmignore
on:
push:
branches: [ production ]
workflow_dispatch:
jobs:
deploy:
name: Build & Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 16
registry-url: https://npm.pkg.github.com
# Build
- name: Build
run: |
npm ci
npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN }}
# Deploy
- name: Deploy To GitHub Pages
uses: peaceiris/[email protected]
with:
personal_token: ${{ secrets.HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN }}
publish_dir: ./build