Repository navigation
ci(website): version the site through changesets, deploy to Cloudflare Workers #828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+7,473
−6,841
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d420996
ci(website): version the site through changesets
chappie-daemon a6d11c9
ci(website): deploy the static site to Cloudflare Workers
chappie-daemon a666801
ci: teach knip the website workspace
chappie-daemon 8c68cfa
ci(website): point the deploy at the website environment
chappie-daemon 42bc27b
ci: apply Greptile review fixes to the website deploy
chappie-daemon b0b8111
chore: resolve .knip.json conflict with nip77
chappie-daemon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| "nostream-website": minor | ||
| --- | ||
|
|
||
| feat(website): version and deploy the marketing site | ||
|
|
||
| `website/site` joins the pnpm workspace as `nostream-website`, so the marketing site is versioned and released through the same changesets flow as the relay. The site builds as a static bundle (docs and changelog render from the repository at build time — no SSR) and deploys to Cloudflare Workers with static assets at ema.tnsor.network through CI. | ||
|
|
||
| The deploy is a Cloudflare Worker with static assets (`website/site/wrangler.jsonc`), built and shipped by the new `Deploy Website` workflow after a release PR merges to `main`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| name: Deploy Website | ||
|
|
||
| # The marketing site deploys after a release lands on main: the changesets | ||
| # release PR bumps nostream-website, merging it is the deploy trigger. Version | ||
| # the site with a changeset, merge the release PR — never deploy from a branch. | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - "website/site/**" | ||
| - "pnpm-lock.yaml" | ||
| - "package.json" | ||
| - "README.md" | ||
| - "CLI.md" | ||
| - "CONFIGURATION.md" | ||
| - "CONTRIBUTING.md" | ||
| - "SECURITY.md" | ||
| - "CHANGELOG.md" | ||
| - "deploy/**" | ||
| - "docs/**" | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: deploy-website | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| deploy: | ||
| # workflow_dispatch ignores the push-branch filter; a manual run must not | ||
| # publish a non-main branch to production. | ||
| if: github.event_name != 'workflow_dispatch' || github.ref == 'refs/heads/main' | ||
| name: Build and deploy to Cloudflare Workers | ||
|
chappie-daemon marked this conversation as resolved.
|
||
| runs-on: ubuntu-latest | ||
| # Deploy credentials live in this GitHub environment: CLOUDFLARE_API_TOKEN | ||
| # secret (Workers Scripts scope) and CLOUDFLARE_ACCOUNT_ID variable. | ||
| environment: website | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
|
|
||
| - uses: actions/setup-node@v3 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: pnpm | ||
|
|
||
| - name: Install workspace dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Build the site | ||
| working-directory: website/site | ||
| env: | ||
| SITE_URL: https://ema.tnsor.network | ||
| run: pnpm run build | ||
|
|
||
| - name: Deploy to Cloudflare Workers | ||
| working-directory: website/site | ||
| env: | ||
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
| CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }} | ||
| run: pnpm exec wrangler deploy | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,46 @@ | ||
| { | ||
| "$schema": "https://unpkg.com/knip@2/schema.json", | ||
| "entry": [ | ||
| "src/index.ts!", | ||
| "src/import-events.ts!", | ||
| "src/cli/index.ts!", | ||
| "src/scripts/benchmark-queries.ts!", | ||
| "knexfile.js!" | ||
| ], | ||
| "project": [ | ||
| "src/**/*.ts!" | ||
| ], | ||
| "ignoreDependencies": [ | ||
| "lzma-native" | ||
| ], | ||
| "ignore": [ | ||
| ".nostr/**", | ||
| "src/utils/relay-probe/**" | ||
| ], | ||
| "commitlint": false, | ||
| "eslint": false, | ||
| "github-actions": false, | ||
| "husky": false, | ||
| "mocha": false, | ||
| "nyc": false, | ||
| "semantic-release": false | ||
| "$schema": "https://unpkg.com/knip@2/schema.json", | ||
| "workspaces": { | ||
| ".": { | ||
| "entry": [ | ||
| "src/index.ts!", | ||
| "src/import-events.ts!", | ||
| "src/cli/index.ts!", | ||
| "src/scripts/benchmark-queries.ts!", | ||
| "knexfile.js!" | ||
| ], | ||
| "project": [ | ||
| "src/**/*.ts!" | ||
| ], | ||
| "ignoreDependencies": [ | ||
| "lzma-native" | ||
| ], | ||
| "ignore": [ | ||
| ".nostr/**", | ||
| "src/utils/relay-probe/**" | ||
| ], | ||
| "commitlint": false, | ||
| "eslint": false, | ||
| "github-actions": false, | ||
| "husky": false, | ||
| "mocha": false, | ||
| "nyc": false, | ||
| "semantic-release": false | ||
| }, | ||
| "website/site": { | ||
| "entry": [ | ||
| "astro.config.mjs", | ||
| "src/**/*.{astro,ts,mjs}", | ||
| "scripts/*.mjs" | ||
| ], | ||
| "ignoreDependencies": [ | ||
| "@fontsource-variable/inter", | ||
| "@fontsource/jetbrains-mono", | ||
| "astro", | ||
| "sharp", | ||
| "wrangler" | ||
| ], | ||
| "astro": true | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.