Skip to content

Deploy to GitHub Pages #81

Deploy to GitHub Pages

Deploy to GitHub Pages #81

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches: [main]
paths:
- 'content/**'
- 'translations/**'
- 'templates/**'
- 'site/**'
workflow_run:
workflows: ['Build Generator JAR']
types: [completed]
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '25'
- name: Restore cached JAR and AOT
id: cache-restore
uses: actions/cache/restore@v5
with:
path: |
html-generators/generate.jar
html-generators/generate.aot
key: generator-${{ hashFiles('html-generators/generate.java') }}
- name: Generate with cached JAR + AOT
if: steps.cache-restore.outputs.cache-hit == 'true'
run: java -XX:AOTCache=html-generators/generate.aot -jar html-generators/generate.jar
- name: Setup JBang (cache miss)
if: steps.cache-restore.outputs.cache-hit != 'true'
uses: jbangdev/setup-jbang@main
- name: Generate with JBang (cache miss)
if: steps.cache-restore.outputs.cache-hit != 'true'
run: jbang html-generators/generate.java
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: site
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4