diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml new file mode 100644 index 0000000..bf41db6 --- /dev/null +++ b/.github/workflows/site.yml @@ -0,0 +1,39 @@ +name: Site +on: + pull_request: + push: + branches: [main] + workflow_dispatch: +permissions: + contents: read +jobs: + test: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v7 + - uses: pnpm/action-setup@v6 + - uses: actions/setup-node@v7 + with: + node-version: 26 + - run: pnpm install --frozen-lockfile + - run: pnpm test + deploy: + if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + needs: test + runs-on: ubuntu-24.04 + # A slower, older run must never overwrite a newer deploy. + concurrency: deploy + steps: + - uses: actions/checkout@v7 + - uses: pnpm/action-setup@v6 + - uses: actions/setup-node@v7 + with: + node-version: 26 + - run: pnpm install --frozen-lockfile + - run: pnpm run deploy --branch main + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: 0a95e814ccf2b6a95d2dc3bea0a4a2b4 + - run: pnpm test + env: + BASE_URL: https://selfie.dev diff --git a/README.md b/README.md index 8cba04e..6e6c924 100644 --- a/README.md +++ b/README.md @@ -16,14 +16,13 @@ pnpm test # checks the redirects, the links, and the 404 against that server [`public/_redirects`](public/_redirects) comes from [selfie-hackathon#26](https://github.com/diffplug/selfie-hackathon/issues/26). Released jars and wheels link to these paths and can't be changed, so the redirects are permanent. **Don't reuse `/jvm`, `/py`, `/demo-gif`, `/go`, `/other-platforms`, or `/js` for anything on this site.** -## Going live +## Deploying -`selfie.dev` is currently on the `selfie` Pages project, along with `lib.selfie.dev`. +`selfie.dev` is the custom domain of the `selfie-landing` Pages project. `lib.selfie.dev` stays on the separate `selfie` project. -1. `pnpm run deploy` publishes `public/` to the `selfie-landing` Pages project. -2. `BASE_URL=https://selfie-landing.pages.dev pnpm test` -3. In the Cloudflare dashboard, remove `selfie.dev` from the `selfie` project and add it to `selfie-landing`. Keep `lib.selfie.dev` on `selfie`. -4. `BASE_URL=https://selfie.dev pnpm test` +Every push to `main` runs the tests, deploys `public/`, and runs the tests again against `https://selfie.dev` ([workflow](.github/workflows/site.yml)). Pull requests only run the tests. Deploying needs a `CLOUDFLARE_API_TOKEN` repository secret, with the Cloudflare Pages Edit permission. + +To deploy by hand, run `pnpm run deploy`. It publishes your local `public/`, including anything uncommitted. ## Licenses diff --git a/package.json b/package.json index fb98989..021fd94 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "selfie-landing", "private": true, "type": "module", + "packageManager": "pnpm@12.16.1", "scripts": { "dev": "wrangler pages dev", "test": "node --test --test-force-exit test/", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5ad6962..bf2364e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,3 +1,161 @@ +--- +lockfileVersion: '9.0' + +importers: + + .: + configDependencies: {} + packageManagerDependencies: + pnpm: + specifier: 12.16.1 + version: 12.16.1 + +packages: + + '@pnpm/exe.android-arm64@12.16.1': + resolution: {integrity: sha512-PKf78Ew+i0CBYf0Xc+eMcqQiqyBT+u8XCVg1F5roc98/6wWfdYlWhrUMmEBiKWaJ3JqHxrtt8l1NwZ7qfJt2/Q==} + cpu: [arm64] + os: [android] + + '@pnpm/exe.android-x64@12.16.1': + resolution: {integrity: sha512-xdu7gMbB98pdvhwMeA6612Of515FDlRUtfA/1f7nWPZfPLnEdSRBO2u+1N0XBtQ/ennhPH/lrxB1gC6gnR/cdg==} + cpu: [x64] + os: [android] + + '@pnpm/exe.darwin-arm64@12.16.1': + resolution: {integrity: sha512-pVbmIIbhixiLvADLu1WA3TaW8FZy/D72R1De27WbbFx8/2mxvnsTyFVm4fO9kjpjMY7RzJd48CiQ96p8fO3ebQ==} + cpu: [arm64] + os: [darwin] + + '@pnpm/exe.darwin-x64@12.16.1': + resolution: {integrity: sha512-xZvQBFqcZjO7vFKTK3XsJpqY6lnBL9EWSLCzVUPq3kZ94+D96gwJCa76xxGNK8Cj32f4eeM91Qg+yNRR4sRpDw==} + cpu: [x64] + os: [darwin] + + '@pnpm/exe.freebsd-x64@12.16.1': + resolution: {integrity: sha512-zTtunfi9mBhRXiXEJYfwiJj0tk7MgTSfqDSRh+Az9FZ9THazVIiQiVNS8jpcsftDOqu7LKNffQdjmgwHDThfUg==} + cpu: [x64] + os: [freebsd] + + '@pnpm/exe.linux-arm64-musl@12.16.1': + resolution: {integrity: sha512-BJ3mOmcmQgcUo92Ee/WfEOt1pRiv3y2MMAkhEiYHd85UiPpHTfFhv+SpCbALmfExzXk3UlaRtMYwHlkQymc4VA==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@pnpm/exe.linux-arm64@12.16.1': + resolution: {integrity: sha512-JaRd5gNxwdNGBBkrZFt8bknrK4YmHVJBW0JMhUQ0fJ0dEYp6C2GT9ExaCqOO8EwYEyqM+jpKgJIK+8WFaJy3ew==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-ppc64@12.16.1': + resolution: {integrity: sha512-FnSV0Jv40S1cMv7vFNWwvu0X567Lec4L4HCRead3CFcD6zQDNbGw81s8N5bcKPahtPD9ApVuhsbmFCx4rw6RMw==} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-riscv64@12.16.1': + resolution: {integrity: sha512-C1Sww4FN5IttD4atRRhAKmQtSGWVp04ZAKNxO8pfu2bkRPwOW+7v+2DH1Xs1W+kZYYpO86BYDvUcadefF+AgaQ==} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-s390x@12.16.1': + resolution: {integrity: sha512-kn2fautsTcxIMODoovQVqZyfpDRdNgGkoeVqNdrKqbeBBvrEl+fXLkmZiq5xDht1LMr4sYiCNcsMfNMT6JPFmg==} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-x64-musl@12.16.1': + resolution: {integrity: sha512-PM6ccHCOe/O9SsTflTJTYWfwogJZa6EmUvpnwZgiPguJBddh20wDQKgxUPXf48rDsPm9vMsIij0uHswwwbXL8g==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@pnpm/exe.linux-x64@12.16.1': + resolution: {integrity: sha512-RK//8ZLcXGW8A2k8bQOXZDBN1Qu92zN4dYnG1bzj1zoQ1fkZ6jNzZ1AvXtsfGVma795CJtvoaF5bLXf4l/FIUw==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.win32-arm64@12.16.1': + resolution: {integrity: sha512-Ox3kNNVxtGw6pK7SVejmeOUgHhUTZgAM7NQQ6cU7frPw3ix9+j7d2MGbRg3fyEFAaKWq8ZAZLTQGcDyLnAu+qA==} + cpu: [arm64] + os: [win32] + + '@pnpm/exe.win32-x64@12.16.1': + resolution: {integrity: sha512-k+FhRJ0ttphFoFIVB1Sk4v76YJAulafmA/Ly57cysesUhhIzVlApeOShUz0jXubKx317TThlEfpQrukldnqORA==} + cpu: [x64] + os: [win32] + + pnpm@12.16.1: + resolution: {integrity: sha512-CR0d7nknV1Zhsl2rPCrjHK/BxU1rce1qZgDPDByxBDSkR+rhQBXxsj4ua+3u1535SpMuIWTSgyKA3OP7MvZW0Q==} + engines: {node: '>=18'} + hasBin: true + +snapshots: + + '@pnpm/exe.android-arm64@12.16.1': + optional: true + + '@pnpm/exe.android-x64@12.16.1': + optional: true + + '@pnpm/exe.darwin-arm64@12.16.1': + optional: true + + '@pnpm/exe.darwin-x64@12.16.1': + optional: true + + '@pnpm/exe.freebsd-x64@12.16.1': + optional: true + + '@pnpm/exe.linux-arm64-musl@12.16.1': + optional: true + + '@pnpm/exe.linux-arm64@12.16.1': + optional: true + + '@pnpm/exe.linux-ppc64@12.16.1': + optional: true + + '@pnpm/exe.linux-riscv64@12.16.1': + optional: true + + '@pnpm/exe.linux-s390x@12.16.1': + optional: true + + '@pnpm/exe.linux-x64-musl@12.16.1': + optional: true + + '@pnpm/exe.linux-x64@12.16.1': + optional: true + + '@pnpm/exe.win32-arm64@12.16.1': + optional: true + + '@pnpm/exe.win32-x64@12.16.1': + optional: true + + pnpm@12.16.1: + optionalDependencies: + '@pnpm/exe.android-arm64': 12.16.1 + '@pnpm/exe.android-x64': 12.16.1 + '@pnpm/exe.darwin-arm64': 12.16.1 + '@pnpm/exe.darwin-x64': 12.16.1 + '@pnpm/exe.freebsd-x64': 12.16.1 + '@pnpm/exe.linux-arm64': 12.16.1 + '@pnpm/exe.linux-arm64-musl': 12.16.1 + '@pnpm/exe.linux-ppc64': 12.16.1 + '@pnpm/exe.linux-riscv64': 12.16.1 + '@pnpm/exe.linux-s390x': 12.16.1 + '@pnpm/exe.linux-x64': 12.16.1 + '@pnpm/exe.linux-x64-musl': 12.16.1 + '@pnpm/exe.win32-arm64': 12.16.1 + '@pnpm/exe.win32-x64': 12.16.1 + +--- lockfileVersion: '9.0' settings: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..3ad1149 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,4 @@ +# Wrangler runs fine without these packages' install scripts, so they stay off. +allowBuilds: + esbuild: false + workerd: false