From 8168c4cae556a9d32f8b2924223c6fbe58d53134 Mon Sep 17 00:00:00 2001 From: axmmisaka <6500159+axmmisaka@users.noreply.github.com> Date: Thu, 14 Dec 2023 00:16:48 -0800 Subject: [PATCH] Adaptation for new Docusaurus-based website (#187) * Replace config git edit URL with new repo's URL * Add CI for docusaurus --------- Co-authored-by: Kagamihara Nadeshiko --- .github/workflows/deploy.yml | 52 ++++++++++++++++++++++++++++++++++++ docusaurus.config.ts | 2 +- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 000000000..0b3f6452e --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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? \ No newline at end of file diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 6e902d916..aa6977753 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -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