~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/pds.js

An atproto PDS in JavaScript, for Cloudflare Workers and Node

0
0
main
34 lines · 1.4 KB Raw History
# Publishes the space browser to spaces.pdsjs.dev on every push to main.
# The deploy writes a record only when the build changes it.
on:
  push: {refs: [refs/heads/main]}
image: node:22-trixie
cache: [/root/.local/share/pnpm/store, /root/.cache/node/corepack]
runners: [ci.knotless.dev]
secrets: [PDSJS_SITE_TOKEN]
env:
  COREPACK_ENABLE_DOWNLOAD_PROMPT: "0"
  PDS_URL: https://pds.pdsjs.dev
  PDS_DID: did:plc:ye5hhvya5o2fwvouv3wttkkn
  # The site record's key is the subdomain it answers on, and the origin is
  # where that subdomain answers. The two must agree: the origin goes into
  # the OAuth client document, and an authorization server refuses a
  # document that names anywhere other than where it was fetched from.
  SPACES_SITE: spaces
  SPACES_ORIGIN: https://spaces.pdsjs.dev
steps:
  - name: check credentials
    run: |
      if [ -z "${PDSJS_SITE_TOKEN:-}" ]; then
        echo "PDSJS_SITE_TOKEN is not granted, so this push would publish nothing."
        echo "Seal it to ci.knotless.dev with knotless secret. It is an app password for pdsjs.dev."
        exit 1
      fi
      echo "publishing to $PDS_URL as $PDS_DID, signing in as $SPACES_ORIGIN/client-metadata.json"
  - name: build
    run: |
      corepack enable
      pnpm install --frozen-lockfile
      pnpm --filter @pdsjs/spaces-ui run build
  - name: publish
    run: PDS_APP_PASSWORD="$PDSJS_SITE_TOKEN" node packages/spaces-ui/scripts/deploy.mjs