From f9df2d8f3da160f21f56f86ee003e417d903340c Mon Sep 17 00:00:00 2001 From: Codilion Date: Mon, 23 Oct 2023 01:56:54 +0200 Subject: [PATCH] Prepare for GitHub actions and GitHub Pages --- .github/workflows/deploy.yml | 43 +++++++++++++++++++++++++++++++ .github/workflows/test-deploy.yml | 24 +++++++++++++++++ docusaurus.config.js | 4 +-- 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/test-deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..a1408f4a --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,43 @@ +name: Deploy to GitHub Pages + +on: + 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 + +jobs: + deploy: + 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 + + # Popular action to deploy to GitHub Pages: + # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + # Build output to publish to the `gh-pages` branch: + publish_dir: ./build + # The following lines assign commit authorship to the official + # GH-Actions bot for deploys to `gh-pages` branch: + # https://github.com/actions/checkout/issues/13#issuecomment-724415212 + # The GH actions bot is used by default if you didn't specify the two fields. + # You can swap them out with your own user credentials. + user_name: github-actions[bot] + user_email: 41898282+github-actions[bot]@users.noreply.github.com diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml new file mode 100644 index 00000000..e2057136 --- /dev/null +++ b/.github/workflows/test-deploy.yml @@ -0,0 +1,24 @@ +name: Test deployment + +on: + pull_request: + 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 + +jobs: + test-deploy: + name: Test deployment + 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: Test build website + run: yarn build diff --git a/docusaurus.config.js b/docusaurus.config.js index 3502fb69..41fe7e29 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -10,9 +10,8 @@ const config = { tagline: 'The most loved token!', favicon: 'img/favicon.ico', - // TODO // Set the production url of your site here - url: 'https://your-docusaurus-test-site.com', + url: 'https://0LNetworkCommunity.github.io', // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' baseUrl: '/', @@ -21,6 +20,7 @@ const config = { // If you aren't using GitHub pages, you don't need these. organizationName: '0LNetworkCommunity', // Usually your GitHub org/user name. projectName: 'documentation', // Usually your repo name. + trailingSlash: false, onBrokenLinks: 'throw', onBrokenMarkdownLinks: 'warn',