diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..e7945d2 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,68 @@ +name: Build & Deploy to GitHub Pages +on: + push: + branches: + - main + workflow_dispatch: + +permissions: {} + +env: + NEODOC_VERSION: 0.1.6 + +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: 20 + 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