Skip to content

Commit cd0de6a

Browse files
committed
feat: use github workflow to build docs
1 parent b460f35 commit cd0de6a

File tree

270 files changed

+78
-14493
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

270 files changed

+78
-14493
lines changed

.github/workflows/docs.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Deploy to Pages
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches: ["master"]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: false
22+
23+
# Default to bash
24+
defaults:
25+
run:
26+
shell: bash
27+
28+
jobs:
29+
# Build job
30+
build:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v3
35+
- name: Detect package manager
36+
id: detect-package-manager
37+
run: |
38+
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
39+
echo "manager=yarn" >> $GITHUB_OUTPUT
40+
echo "command=install" >> $GITHUB_OUTPUT
41+
exit 0
42+
elif [ -f "${{ github.workspace }}/package.json" ]; then
43+
echo "manager=npm" >> $GITHUB_OUTPUT
44+
echo "command=ci" >> $GITHUB_OUTPUT
45+
exit 0
46+
else
47+
echo "Unable to determine package manager"
48+
exit 1
49+
fi
50+
- name: Setup Node
51+
uses: actions/setup-node@v3
52+
with:
53+
node-version: "18"
54+
cache: ${{ steps.detect-package-manager.outputs.manager }}
55+
- name: Setup Pages
56+
id: pages
57+
uses: actions/configure-pages@v3
58+
- name: Install dependencies
59+
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
60+
- name: Build
61+
run: ${{ steps.detect-package-manager.outputs.manager }} run build
62+
- name: Upload artifact
63+
uses: actions/upload-pages-artifact@v1
64+
with:
65+
path: ./docs
66+
67+
# Deployment job
68+
deploy:
69+
environment:
70+
name: github-pages
71+
url: ${{ steps.deployment.outputs.page_url }}
72+
runs-on: ubuntu-latest
73+
needs: build
74+
steps:
75+
- name: Deploy to GitHub Pages
76+
id: deployment
77+
uses: actions/deploy-pages@v2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules/
22
.vscode/
3+
docs/

docs/difficulty/easy/index.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)