pages #3649
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 site | |
on: | |
push: | |
branches: | |
- "main" | |
paths: | |
- site/** | |
- "scripts/gh-pages.sh" | |
- "make/site.mk" | |
- ".github/workflows/pages.yml" | |
workflow_dispatch: | |
repository_dispatch: | |
types: | |
- pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: pages | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build | |
# TODO: Add check for source repository | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install uniget | |
uses: uniget-org/uniget-action@v1 | |
with: | |
prefix: helper | |
tools: hugo regclient gojq | |
- name: Create metadata | |
run: | | |
make metadata.json | |
- name: Install hugo | |
run: | | |
make site-prerequisites | |
- name: Create pages | |
run: | | |
make -j4 pages | |
- name: Create site | |
run: | | |
make site | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: ./site/public | |
- name: Store metadata | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: metadata | |
path: "metadata.json" | |
deploy: | |
name: Deploy | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
needs: | |
- build | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |