This commit is contained in:
+50
-1
@@ -95,5 +95,54 @@ nix flake update
|
||||
* Deployment
|
||||
|
||||
The site is deployed to Cloudflare Pages automatically on push via a Gitea Actions
|
||||
workflow running on a Raspberry Pi runner (=aarch64-linux=).
|
||||
workflow (=.gitea/workflows/deploy.yml=) running on a Raspberry Pi runner (=aarch64-linux=).
|
||||
The =nix build= output is uploaded directly as the Pages deployment artifact.
|
||||
|
||||
** First-time setup
|
||||
|
||||
*** 1. Create a Cloudflare Pages project
|
||||
|
||||
In the Cloudflare dashboard → Pages → Create a project → *Direct Upload*.
|
||||
Name it =personal-site= (must match the =--project-name= flag in the workflow).
|
||||
Skip the initial upload — CI will handle it.
|
||||
|
||||
Alternatively, create it with Wrangler locally:
|
||||
|
||||
#+begin_src sh
|
||||
npx wrangler pages project create personal-site
|
||||
#+end_src
|
||||
|
||||
*** 2. Get your Cloudflare credentials
|
||||
|
||||
- *Account ID*: Cloudflare dashboard → right sidebar, or any zone overview page.
|
||||
- *API Token*: My Profile → API Tokens → Create Token.
|
||||
Use the *Edit Cloudflare Pages* template, or create a custom token with:
|
||||
- Permission: =Cloudflare Pages= → =Edit=
|
||||
- Account resource: your account
|
||||
|
||||
*** 3. Add secrets to Gitea
|
||||
|
||||
In the Gitea repo → Settings → Secrets → Actions, add:
|
||||
|
||||
| Secret name | Value |
|
||||
|--------------------------+------------------------------|
|
||||
| =CLOUDFLARE_API_TOKEN= | the API token from step 2 |
|
||||
| =CLOUDFLARE_ACCOUNT_ID= | your numeric account ID |
|
||||
|
||||
*** 4. Verify the runner label
|
||||
|
||||
The workflow uses =runs-on: ubuntu-latest=.
|
||||
Check your Gitea runner's label in *Site Administration → Runners* and update the
|
||||
workflow if your runner uses a different label (e.g. =nix=, =self-hosted=, etc.).
|
||||
|
||||
The runner needs *Nix* (with flakes enabled) and *Node.js* on =PATH=.
|
||||
If Node.js is not available system-wide you can prepend the build step with:
|
||||
|
||||
#+begin_src sh
|
||||
nix-shell -p nodejs --run "npx --yes wrangler@3 pages deploy ..."
|
||||
#+end_src
|
||||
|
||||
*** 5. Push to master
|
||||
|
||||
The workflow triggers on every push to =master=.
|
||||
Check the Actions tab in Gitea to monitor runs.
|
||||
|
||||
Reference in New Issue
Block a user