Skip to content

Deploy to GitHub Pages #69

Deploy to GitHub Pages

Deploy to GitHub Pages #69

Workflow file for this run

name: Deploy to GitHub Pages
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
get_commits:
runs-on: ubuntu-latest
outputs:
commit_count: ${{ steps.commit_count.outputs.commit_count }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: commit_count
run: echo "commit_count=$(git log --oneline --since '24 hours ago' | wc -l)" >> "$GITHUB_OUTPUT"
build:
name: Build
runs-on: ubuntu-latest
needs: get_commits
if: ${{ needs.get_commits.outputs.commit_count > 0 }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- uses: typst-community/setup-typst@v3
with:
cache-dependency-path: dependencies.typ
- name: Build website
run: npm run build
- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: build
deploy:
name: Deploy to GitHub Pages
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
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