Skip to content

Commit

Permalink
Adaptation for new Docusaurus-based website (#187)
Browse files Browse the repository at this point in the history
* Replace config git edit URL with new repo's URL

* Add CI for docusaurus

---------

Co-authored-by: Kagamihara Nadeshiko <[email protected]>
  • Loading branch information
axmmisaka and Kagamihara Nadeshiko authored Dec 14, 2023
1 parent 3088664 commit 8168c4c
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# https://docusaurus.io/docs/deployment#triggering-deployment-with-github-actions
# Author: axmmisaka; WTFPL or BSD 3-clause

name: Deploy to GitHub Pages

on:
pull_request:
push:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

permissions:
contents: write
pages: write
id-token: write

jobs:
build:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build website
run: yarn build
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./build

# Deployment job
deploy:
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3

# TODO: Deploy to some third-party place for preview?
2 changes: 1 addition & 1 deletion docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const config: Config = {
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/axmmisaka/lf-docs-docusaurus/tree/master/docs/',
'https://github.com/lf-lang/lf-lang.github.io/tree/master/',
beforeDefaultRemarkPlugins: [
// Honestly, I recommend not using this because I am not confident with my coding skill......
// TransformDynamicLFFileImportToStatic
Expand Down

0 comments on commit 8168c4c

Please sign in to comment.