Build & Deploy to GitHub Pages #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Deploy to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 5 * * 0" | |
workflow_dispatch: | |
permissions: {} | |
env: | |
NEODOC_VERSION: 0.2.0 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: "pnpm" | |
- run: pnpm install | |
- run: pnpm build | |
# Install mono | |
- name: Install mono | |
run: sudo apt-get install -y mono-complete | |
- uses: actions/checkout@v4 | |
# ttt2 repo in subfolder | |
with: | |
repository: "TTT-2/TTT2" | |
path: "ttt2" | |
- name: Get NeoDoc | |
run: | | |
wget -c https://github.com/TTT-2/NeoDoc/releases/download/v${NEODOC_VERSION}/NeoDoc-v${NEODOC_VERSION}.zip -O neodoc.zip | |
unzip -u neodoc.zip | |
rm neodoc.zip | |
- name: Generate Documentation | |
run: | | |
mkdir -p output | |
mono NeoDoc.exe ttt2 output || exit_code=$? | |
- name: Move generated data | |
run: mv output dist/data | |
- uses: actions/upload-pages-artifact@v3 | |
with: | |
path: "dist" | |
deploy: | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |