Deploy Quartz site to GitHub Pages #125
This file contains hidden or 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: Deploy Quartz site to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| repository_dispatch: | |
| types: [trigger-workflow] | |
| schedule: | |
| - cron: '0 0 * * *' | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| - name: Install Dependencies | |
| run: npm ci | |
| - name: Download BYOND | |
| run: | | |
| wget https://byond-builds.dm-lang.org/516/516.latest_byond.zip -O byond.zip | |
| unzip byond.zip | |
| - name: Set BYOND version in config | |
| run: | | |
| BYOND_VERSION=$(strings byond/bin/byondcore.dll | grep -oE 'Version [0-9]{3}\.[0-9]{4}' | sed 's/Version //') | |
| sed -i "s/%BYOND VERSION%/$BYOND_VERSION/" quartz.config.ts | |
| - uses: actions/checkout@v6 | |
| with: | |
| repository: hry-gh/dm-ref-scraper | |
| path: dm-ref-scraper | |
| - name: Run Scraping Tool | |
| run: | | |
| cd dm-ref-scraper | |
| cargo run -- --ref $GITHUB_WORKSPACE/byond/help/ref/info.html --output $GITHUB_WORKSPACE/content | |
| - name: Prepare assets | |
| run: | | |
| wget https://raw.githubusercontent.com/adrienverge/copr-some-nice-fonts/590400b0e1426d7b10bdda48ab565d3d2b144f5e/Verdana.ttf -O quartz/redistless/Verdana.ttf | |
| wget https://raw.githubusercontent.com/ueaner/fonts/8c1bccdc1622a2538c35abbd004ce367a949f642/Menlo-Regular.ttf -O quartz/redistless/Menlo.ttf | |
| - name: Build Quartz | |
| run: npx quartz build --directory $GITHUB_WORKSPACE/content | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: public | |
| deploy: | |
| needs: build | |
| 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@v5 |