Skip to content

Commit 3908c39

Browse files
pyphiliakim
andauthored
ci: setup deploy on github pages (#2057)
* ci: setup deploy on github pages * docs: fix permission warning --------- Co-authored-by: kim <kim.phanhoang@epfl.ch>
1 parent 4b2c59f commit 3908c39

2 files changed

Lines changed: 76 additions & 0 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Deploy Database Documentation to GitHub Pages
2+
3+
on:
4+
# Allow the workflow to be manually triggered
5+
workflow_dispatch:
6+
# Automatically trigger on push to main
7+
push:
8+
branches:
9+
- main
10+
11+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
12+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
13+
concurrency:
14+
group: 'pages'
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 24
28+
29+
- name: Get yarn cache directory
30+
id: yarn-cache-dir-path
31+
run: |
32+
echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
33+
34+
- uses: actions/cache@v4
35+
with:
36+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
37+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
38+
restore-keys: |
39+
${{ runner.os }}-yarn-
40+
41+
# - name: yarn install and generate docs
42+
# run: |
43+
# yarn
44+
# yarn db-doc:generate
45+
46+
- name: Upload artifact
47+
uses: actions/upload-pages-artifact@v3
48+
with:
49+
path: ./db-documentation
50+
51+
# Deployment job
52+
deploy:
53+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
54+
permissions:
55+
pages: write
56+
id-token: write
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
runs-on: ubuntu-latest
61+
needs: build
62+
steps:
63+
- name: Deploy to GitHub Pages
64+
id: deployment
65+
uses: actions/deploy-pages@v4

db-documentation/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Test page</title>
7+
</head>
8+
<body>
9+
<div id="root"></div>
10+
</body>
11+
</html>

0 commit comments

Comments
 (0)