57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
name: pages
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- src/**/*
|
|
- public/**/*
|
|
- .forgejo/workflows/pages.yml
|
|
- astro.config.mjs
|
|
- tsconfig.json
|
|
- package.json
|
|
- flake.nix
|
|
- flake.lock
|
|
- bun.lock
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: trixie
|
|
timeout-minutes: 5
|
|
env:
|
|
TERM: dumb
|
|
NIX_INSTALLER_INIT: "none"
|
|
NIX_INSTALLER_NO_CONFIRM: "true"
|
|
NIX_INSTALLER_ENABLE_FLAKES: "true"
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: https://code.forgejo.org/actions/checkout@v6.0.1
|
|
- name: Setup lix toolchain
|
|
run: curl -sL https://install.lix.systems/lix | sh -s -- install linux
|
|
- name: Install bun dependencies
|
|
run: nix develop -c bun install --frozen-lockfile
|
|
- name: Build static files for website
|
|
run: nix develop -c bun run build
|
|
- name: Upload static files
|
|
uses: https://code.forgejo.org/forgejo/upload-artifact@v5
|
|
with:
|
|
name: website-${{ forge.sha }}
|
|
retention-days: 1
|
|
path: dist
|
|
deploy:
|
|
needs: [build]
|
|
runs-on: trixie
|
|
env: { TERM: "dumb" }
|
|
container: { image: "node:current" }
|
|
timeout-minutes: 5
|
|
steps:
|
|
- name: Download static files
|
|
uses: https://code.forgejo.org/forgejo/download-artifact@v7
|
|
with: { name: "website-${{ forge.sha }}", path: "dist" }
|
|
- name: Deploy website to cloudflare
|
|
uses: https://github.com/cloudflare/wrangler-action@v3.14.1
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
command: pages deploy dist --project-name=website
|