Skip to content

Commit 883cdb6

Browse files
committed
Added github actions
1 parent 63e3c24 commit 883cdb6

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

.github/workflows/website-deploy.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: website-deploy-to-github-pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
# Review gh actions docs if you want to further define triggers, paths, etc
8+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
9+
10+
jobs:
11+
deploy:
12+
name: Deploy to GitHub Pages
13+
runs-on: ubuntu-latest
14+
defaults:
15+
run:
16+
shell: bash
17+
working-directory: website
18+
steps:
19+
- uses: actions/checkout@v2
20+
- uses: actions/setup-node@v3
21+
with:
22+
node-version: 18
23+
cache: npm
24+
cache-dependency-path: website/package-lock.json
25+
- name: Install dependencies
26+
run: npm ci
27+
- name: Build website
28+
run: npm run build
29+
30+
# Popular action to deploy to GitHub Pages:
31+
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
32+
- name: Deploy to GitHub Pages
33+
uses: peaceiris/actions-gh-pages@v3
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
# Build output to publish to the `gh-pages` branch:
37+
publish_dir: ./website/build
38+
# The following lines assign commit authorship to the official
39+
# GH-Actions bot for deploys to `gh-pages` branch:
40+
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
41+
# The GH actions bot is used by default if you didn't specify the two fields.
42+
# You can swap them out with your own user credentials.
43+
user_name: github-actions[bot]
44+
user_email: github-actions[bot]@users.noreply.github.com
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: website-test-deployment
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test-deploy:
10+
name: Test deployment
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
shell: bash
15+
working-directory: website
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-node@v3
19+
with:
20+
node-version: 18
21+
cache: npm
22+
cache-dependency-path: website/package-lock.json
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
- name: Test build website
27+
run: npm run build

0 commit comments

Comments
 (0)