forked from adobe/spectrum-web-components
-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (30 loc) · 1.25 KB
/
publish.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
name: Site publish
on:
workflow_dispatch:
push:
branches:
- main
jobs:
site-build:
name: Build & publish site
runs-on: ubuntu-latest
# Run the job if manually triggered or if the commit message includes '#publish' & the check suite has passed
if: github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '#publish')
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Generate Docs
run: yarn docs:ci
- name: Deploy to GitHub Pages
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
touch projects/documentation/dist/.nojekyll
npx gh-pages -d projects/documentation/dist -m "[skip ci] update demonstration site" -t -u "github-actions-bot <[email protected]>"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}