Skip to content

Commit b9904a5

Browse files
authored
Add workflows. (#3016)
* Add workflows. Signed-off-by: merobi-hub <[email protected]> --------- Signed-off-by: merobi-hub <[email protected]>
1 parent c3af853 commit b9904a5

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: 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+
build:
12+
name: Build Docusaurus
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 18
21+
cache: yarn
22+
cache-dependency-path: ./docs/yarn.lock
23+
24+
- name: Install dependencies
25+
run: yarn install --frozen-lockfile
26+
working-directory: ./docs
27+
- name: Build website
28+
run: yarn build
29+
working-directory: ./docs
30+
31+
- name: Upload Build Artifact
32+
uses: actions/upload-pages-artifact@v3
33+
with:
34+
path: build
35+
36+
deploy:
37+
name: Deploy to GitHub Pages
38+
needs: build
39+
40+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
41+
permissions:
42+
pages: write # to deploy to Pages
43+
id-token: write # to verify the deployment originates from an appropriate source
44+
45+
# Deploy to the github-pages environment
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deployment.outputs.page_url }}
49+
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: Deploy to GitHub Pages
53+
id: deployment
54+
uses: actions/deploy-pages@v4

.github/workflows/test-website.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Test deployment
2+
3+
on:
4+
pull_request:
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+
test-deploy:
12+
name: Test deployment
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 18
21+
cache: yarn
22+
cache-dependency-path: ./docs/yarn.lock
23+
- name: Install dependencies
24+
run: yarn install --frozen-lockfile
25+
working-directory: ./docs
26+
- name: Test build website
27+
run: yarn build
28+
working-directory: ./docs

0 commit comments

Comments
 (0)