Skip to content

Commit 388270a

Browse files
axmmisakaKagamihara Nadeshiko
authored andcommitted
Adaptation for new Docusaurus-based website (lf-lang#187)
* Replace config git edit URL with new repo's URL * Add CI for docusaurus --------- Co-authored-by: Kagamihara Nadeshiko <[email protected]>
1 parent a83fc1e commit 388270a

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# https://docusaurus.io/docs/deployment#triggering-deployment-with-github-actions
2+
# Author: axmmisaka; WTFPL or BSD 3-clause
3+
4+
name: Deploy to GitHub Pages
5+
6+
on:
7+
pull_request:
8+
push:
9+
branches:
10+
- main
11+
# Review gh actions docs if you want to further define triggers, paths, etc
12+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
13+
14+
permissions:
15+
contents: write
16+
pages: write
17+
id-token: write
18+
19+
jobs:
20+
build:
21+
name: Deploy to GitHub Pages
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v3
25+
- uses: actions/setup-node@v3
26+
with:
27+
node-version: 18
28+
cache: yarn
29+
30+
- name: Install dependencies
31+
run: yarn install --frozen-lockfile
32+
- name: Build website
33+
run: yarn build
34+
- name: Upload artifact
35+
uses: actions/upload-pages-artifact@v2
36+
with:
37+
path: ./build
38+
39+
# Deployment job
40+
deploy:
41+
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
runs-on: ubuntu-latest
46+
needs: build
47+
steps:
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v3
51+
52+
# TODO: Deploy to some third-party place for preview?

docusaurus.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const config: Config = {
4141
// Please change this to your repo.
4242
// Remove this to remove the "edit this page" links.
4343
editUrl:
44-
'https://github.com/axmmisaka/lf-docs-docusaurus/tree/master/docs/',
44+
'https://github.com/lf-lang/lf-lang.github.io/tree/master/',
4545
beforeDefaultRemarkPlugins: [
4646
// Honestly, I recommend not using this because I am not confident with my coding skill......
4747
// TransformDynamicLFFileImportToStatic

0 commit comments

Comments
 (0)