Skip to content

Commit 5372f18

Browse files
authored
Create workflow for deployment
1 parent 1c92959 commit 5372f18

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# https://docusaurus.io/docs/deployment#deploying-to-github-pages
2+
3+
name: Deploy to GitHub Pages
4+
5+
on:
6+
push:
7+
branches: [ "master" ]
8+
pull_request:
9+
branches: [ "master" ]
10+
11+
jobs:
12+
test-deploy:
13+
if: github.event_name != 'push'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: 18
20+
cache: yarn
21+
- name: Install dependencies
22+
working-directory: ./website
23+
run: yarn install --frozen-lockfile
24+
- name: Test build website
25+
working-directory: ./website
26+
run: yarn build
27+
28+
deploy:
29+
if: github.event_name != 'pull_request'
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v3
33+
- uses: actions/setup-node@v3
34+
with:
35+
node-version: 18
36+
cache: yarn
37+
- uses: webfactory/ssh-agent@v0.5.0
38+
with:
39+
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
40+
- name: Deploy to GitHub Pages
41+
env:
42+
GIT_USER: personiumio
43+
USE_SSH: true
44+
working-directory: ./website
45+
run: |
46+
git config --global user.email "personiumio@gmail.com"
47+
git config --global user.name "personiumio"
48+
yarn install --frozen-lockfile
49+
yarn run publish-gh-pages

0 commit comments

Comments
 (0)