Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Site

# Builds site/ and deploys it to Cloudflare Pages.
#
# Secrets to set once, at Settings → Secrets and variables → Actions →
# New repository secret:
#
# CLOUDFLARE_ACCOUNT_ID Cloudflare dashboard → Workers & Pages. The account
# ID is in the right-hand sidebar.
# CLOUDFLARE_API_TOKEN Cloudflare dashboard → My Profile → API Tokens →
# Create Token → "Edit Cloudflare Workers" template,
# or a custom token with the Account permission
# "Cloudflare Pages: Edit".
#
# The Pages project itself must exist and be named `offdesk` — create it once
# in the dashboard (Workers & Pages → Create → Pages → Direct Upload), then
# this workflow uploads every build to it.

on:
push:
branches: [main]
paths:
- "site/**"
- ".github/workflows/site.yml"
workflow_dispatch:

concurrency:
group: site-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write

steps:
- uses: actions/checkout@v6

# site/ is its own pnpm root (site/pnpm-workspace.yaml) so the app
# workspace never has to install Astro.
- uses: pnpm/action-setup@v4
with:
package_json_file: site/package.json

- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: site/pnpm-lock.yaml

- name: Install
working-directory: site
run: pnpm install --frozen-lockfile

- name: Build
working-directory: site
run: pnpm build

- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: >-
pages deploy site/dist
--project-name=offdesk
--branch=${{ github.ref_name }}
3 changes: 3 additions & 0 deletions site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
node_modules/
.astro/
15 changes: 15 additions & 0 deletions site/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# offdesk.dev

The one-page site. Astro, no framework components, no client-side framework.

```bash
pnpm install
pnpm dev # http://localhost:4321
pnpm build # -> site/dist
```

`site/public/` is copied to the root of the output, so `public/install` is
served at `https://offdesk.dev/install` and `public/media/hero.gif` at
`/media/hero.gif`.

Deployed by `.github/workflows/site.yml` on push to `main`.
9 changes: 9 additions & 0 deletions site/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from "astro/config";

// One page, no framework components, no client-side framework runtime.
// `astro build` writes a plain static directory to site/dist, which is what
// Cloudflare Pages serves.
export default defineConfig({
site: "https://offdesk.dev",
compressHTML: true,
});
15 changes: 15 additions & 0 deletions site/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "offdesk-site",
"private": true,
"license": "MIT",
"type": "module",
"packageManager": "pnpm@10.23.0",
"scripts": {
"dev": "astro dev",
"build": "astro build",
"preview": "astro preview"
},
"devDependencies": {
"astro": "^5.16.2"
}
}
Loading
Loading