Supersample OG PNGs: render at 3x then downsample to 1200x630 #110
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 to GitHub Pages | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'content/**' | |
| - 'translations/**' | |
| - 'templates/**' | |
| - 'site/**' | |
| - 'html-generators/generateog.java' | |
| workflow_run: | |
| workflows: ['Build Generator JARs'] | |
| 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 generate 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 HTML 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 HTML with JBang (cache miss) | |
| if: steps.cache-restore.outputs.cache-hit != 'true' | |
| run: jbang html-generators/generate.java | |
| - name: Restore cached generateog JAR and AOT | |
| id: cache-restore-og | |
| uses: actions/cache/restore@v5 | |
| with: | |
| path: | | |
| html-generators/generateog.jar | |
| html-generators/generateog.aot | |
| key: generateog-${{ hashFiles('html-generators/generateog.java') }} | |
| - name: Generate OG cards with cached JAR + AOT | |
| if: steps.cache-restore-og.outputs.cache-hit == 'true' | |
| run: java -XX:AOTCache=html-generators/generateog.aot -jar html-generators/generateog.jar | |
| - name: Generate OG cards with JBang (cache miss) | |
| if: steps.cache-restore-og.outputs.cache-hit != 'true' | |
| run: | | |
| if ! command -v jbang &> /dev/null; then | |
| echo "Installing JBang..." | |
| curl -Ls https://sh.jbang.dev | bash -s - app setup | |
| export PATH="$HOME/.jbang/bin:$PATH" | |
| fi | |
| jbang html-generators/generateog.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 |