name: "Deploy"
on: ["push"]

jobs:
  build:
    runs-on: "docker"
    container:
      image: "code.forgejo.org/oci/alpine:3.21"
    steps:
      - name: "Checkout"
        uses: "https://code.forgejo.org/actions/checkout@v4"

      - name: "Setup pnpm"
        uses: "https://github.com/pnpm/action-setup@v4"
        with:
          version: 10

      - name: "Setup Node.js"
        uses: "https://github.com/actions/setup-node"
        with:
          node-version-file: "package.json"
          cache: "pnpm"

      - name: "Install dependencies"
        run: "pnpm install"

      - name: "Build"
        run: "pnpm build"

      - name: "Upload"
        uses: "https://code.forgejo.org/forgejo/upload-artifact@v4"
        with:
          name: "site.zip"
          if-no-files-found: "error"
          path: |
            ./dist/**/*
            !dist/.vite