Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 12 additions & 30 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
5 changes: 5 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
3 changes: 1 addition & 2 deletions docs/content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ extra_css:
- stylesheets/extra.css

extra:
version:
provider: mike
social:
- icon: fontawesome/brands/discord
link: https://discord.gg/bWSWuYvURP
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
mkdocs-material
mkdocs-awesome-pages-plugin
mike