.github/workflows/staticalize.yaml #94
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
on: | |
workflow_dispatch: # Allows manual trigger | |
schedule: | |
- cron: "0 */8 * * *" # Runs every 8 hours | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
staticalize: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # Needed for auth with Deno Deploy | |
contents: read # Needed to clone the repository | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Deno | |
uses: denoland/setup-deno@v2 | |
with: | |
deno-version: v2.x | |
- run: | | |
deno task dev & | |
until curl --output /dev/null --silent --head --fail http://127.0.0.1:8000; do | |
printf '.' | |
sleep 1 | |
done | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
JSR_API: ${{ secrets.JSR_API }} | |
- name: Download Staticalize | |
run: | | |
wget https://github.com/thefrontside/staticalize/releases/download/v0.0.1/staticalize-linux.tar.gz \ | |
-O /tmp/staticalize-linux.tar.gz | |
tar -xzf /tmp/staticalize-linux.tar.gz -C /usr/local/bin | |
chmod +x /usr/local/bin/staticalize-linux | |
- name: Staticalize | |
run: | | |
staticalize-linux \ | |
--site=http://127.0.0.1:8000 \ | |
--output=built \ | |
--base=https://effection-www.deno.dev/ | |
- run: npx pagefind --site built | |
- name: Upload to Deno Deploy | |
uses: denoland/deployctl@v1 | |
with: | |
project: effection-www | |
entrypoint: "https://jsr.io/@std/http/1.0.12/file_server.ts" | |
root: built |