diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index f82c9328980..28641f84243 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -2,13 +2,11 @@ name: Publish docs via GitHub Pages on: workflow_dispatch: push: - branches: [1.20.1] + branches: ["1.20.1", "1.21"] paths: ['docs/**'] permissions: - contents: read - pages: write - id-token: write + contents: write concurrency: group: 'pages' @@ -24,33 +22,17 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: '1.20.1' - sparse-checkout: './docs' + ref: '${{ github.ref_name }}' + fetch-depth: 0 - uses: actions/setup-python@v4 with: python-version: '3.11' cache: 'pip' - - run: pip install -r ./requirements.txt - - uses: actions/cache@v4 - with: - key: 'mkdocs-cache' - path: './docs/.cache' - - name: Build static files - id: mkdocs - run: mkdocs build - - name: Upload pages as artifact - id: artifact - uses: actions/upload-pages-artifact@v3 - with: - path: './docs/site/' - - deploy: - runs-on: ubuntu-latest - needs: build - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Deploy Pages - id: deployment - uses: actions/deploy-pages@v4 + - name: Install packages + run: pip install -r ./requirements.txt + - name: Set git username and password + run: git config user.name 'github-actions[bot]'; git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + - name: Deploy pages to gh-pages branch + run: mike deploy "${{ github.ref_name }}" --push + - name: Ensure 1.20.1 is the default version + run: mike set-default 1.20.1 --push \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 4686e4e4b57..66b84b35b54 100644 --- a/docs/README.md +++ b/docs/README.md @@ -79,3 +79,8 @@ mkdocs serve The following plugins for MkDocs are being used: - https://squidfunk.github.io/mkdocs-material/ - https://github.com/lukasgeiter/mkdocs-awesome-pages-plugin + +## Deployment +The hosted documentation is found on the `gh-pages` branch of the repository. [Mike](https://github.com/jimporter/mike) is used to deploy both the 1.20.1 and 1.21.1 documentation on the same site through Github Actions. + +When working on the docs locally, the plain `mkdocs` commands should be used to view the changes made to the version of the docs you are currently working on, like the previously mentioned `mkdocs serve`. \ No newline at end of file diff --git a/docs/content/index.md b/docs/content/index.md index 51dc1e6d725..d9f96c06844 100644 --- a/docs/content/index.md +++ b/docs/content/index.md @@ -5,8 +5,7 @@ hide: title: Home --- - -# Welcome to GregTech CEu Modern's Documentation! +# Welcome to GregTech CEu Modern's Documentation for 1.20.1! GregTech CEu Modern is a port of [GregTech Community Edition Unofficial](https://github.com/GregTechCEu/GregTech) to modern Minecraft versions. diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index f5072ad3755..2ce13daed00 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -47,6 +47,8 @@ extra_css: - stylesheets/extra.css extra: + version: + provider: mike social: - icon: fontawesome/brands/discord link: https://discord.gg/bWSWuYvURP diff --git a/docs/requirements.txt b/docs/requirements.txt index 80c8e8446b0..9ee0202d764 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1,3 @@ mkdocs-material mkdocs-awesome-pages-plugin +mike \ No newline at end of file