Skip to content

Commit

Permalink
Add Cloudflare Pages option
Browse files Browse the repository at this point in the history
  • Loading branch information
mzyy94 committed Mar 2, 2024
1 parent 17f2030 commit 2679215
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Create
- name: Deploy Workers
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
Expand All @@ -29,3 +29,13 @@ jobs:
JWT_SECRET: ${{ secrets.JWT_SECRET }}
FEED_OWNER: ${{ secrets.FEED_OWNER }}
FEED_HOST: ${{ secrets.FEED_HOST }}
- name: Publish Pages
env:
PAGES_PROJECT: ${{ secrets.PAGES_PROJECT }}
if: ${{ env.PAGES_PROJECT != '' }}
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
projectName: ${{ secrets.PAGES_PROJECT }}
directory: public
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ FEED_HOST=bluebookmark-feed.example.com
Run `pnpm run init:local` only for the first time.
Start up local server with `pnpm run dev`.

### Cloudflare Pages (Optional)

If you want to serve static HTMLs from Cloudflare Pages, run `wrangler pages project create <YOUR-UNIQUE-PROJECT-NAME>` once and `wrangler pages deploy public` for each change.
To deploy to Cloudflare Pages on CI, set the project name to `PAGES_PROJECT` environment secret.

## Privacy
- The App Password is only used for user identification and availability checks and is not stored, so it is secure.
- Bookmarks are visible to administrators because the data stored in the database is not encrypted.
Expand Down

0 comments on commit 2679215

Please sign in to comment.