Skip to content

ci: add Filebase pin step after Pinata pin - #41

Merged
AI-M4K3R merged 2 commits into
mainfrom
ci/add-filebase-deploy-pinning
Nov 20, 2026
Merged

AI-M4K3R merged 2 commits into
mainfrom
ci/add-filebase-deploy-pinning

Conversation

@AI-M4K3R

Copy link
Copy Markdown
Collaborator

What

Adds a Pin to Filebase step to the deploy job, directly after the Pinata step, so every deploy CID is pinned at 4EVERLAND → Pinata → Filebase.

API verified from current official Filebase docs

  • Pin-by-CID: POST https://api.filebase.io/v1/ipfs/pins with JSON {"cid": "...", "name": "site"} — the documented way to re-pin an existing CID (docs: Pinning files → Re-pin an existing CID and IPFS Pinning Service API).
  • Success: 202 Accepted returning a PinStatus (requestid, status) — the step requires 202 and fails otherwise.
  • Auth: Authorization: Bearer <access-token> where the token is a per-bucket Secret Access Token generated in the console (Access Keys → IPFS RPC API endpoint → Choose Bucket to Generate Token). Important: the current docs do not document using the S3 access-key/secret pair against /v1/ipfs/pins — those authenticate the S3 API (SigV4, s3.filebase.io) and the Platform API only. See owner steps below.
  • Redeploy handling: the step first lists pins (GET /v1/ipfs/pins?name=site&match=exact&limit=1, 200) and replaces the existing pin (POST /v1/ipfs/pins/{requestid}, 202 — documented replace semantics) instead of stacking duplicate pins, mirroring the 4EVERLAND step. It then polls GET /v1/ipfs/pins/{requestid} (max 60s) and fails the deploy on any error: non-200 list, non-202 create/replace, failed status, or poll timeout — no silent skips.

Checks

  • actionlint: no issues in the new step (the two SC2086 shellcheck infos in the 4EVERLAND step pre-exist on main, verified against origin/main).
  • YAML parse + step-order assertion + bash -n on the embedded script: clean.
  • pnpm lint (biome): 107 files, clean.
  • Deploy not run end-to-end: the pipeline's first step downloads the IPFS binary from dist.ipfs.tech, which is currently down worldwide — lint/validation only (per standing note on the dist.ipfs.tech outage).

Owner steps (before the first Filebase pin can succeed)

  1. IPFS bucket: Filebase pinning requires an IPFS-backed bucket to exist; create one in the console if not already present (bucket creation is console-only).
  2. Pin token secret: generate the bucket's Secret Access Token (console → Access Keys → IPFS RPC API endpoint → Choose Bucket to Generate Token) and store it as the FILEBASE_TOKEN Actions secret. The step reads ${{ secrets.FILEBASE_TOKEN || secrets.FILEBASE_SECRET }} — if the already-set FILEBASE_SECRET holds this token it works as-is; if it holds the S3 secret key, the pins API will reject it with 401 and the token must go into FILEBASE_TOKEN.

Related worker-side change: nipsysdev/gwei-site#6 fills the Filebase gateway slot in the serving failover chain.

Pin every deploy CID to Filebase via its IPFS Pinning Service API
(POST https://api.filebase.io/v1/ipfs/pins, Bearer token, JSON {cid, name}),
verified against the current Filebase docs:
- re-pin existing CID: pinning-files guide -> Pinning Service API
- auth: per-bucket Secret Access Token generated in the console
  (Access Keys -> IPFS RPC API endpoint -> Choose Bucket to Generate Token)
- replace flow (POST /pins/{requestid}) reuses the existing 'site' pin on
  redeploy instead of stacking duplicate pins, mirroring the 4EVERLAND step

The step fails the deploy on any error: non-200 list, non-202 create/replace,
'failed' pin status, or a 60s poll timeout. FILEBASE_TOKEN secret holds the
pin token (falls back to FILEBASE_SECRET if the token was stored there).
@AI-M4K3R
AI-M4K3R marked this pull request as ready for review November 20, 2026 11:29
@AI-M4K3R
AI-M4K3R requested a review from nipsysdev November 20, 2026 11:29
@AI-M4K3R
AI-M4K3R merged commit 6e3f60b into main Nov 20, 2026
5 checks passed
@nipsysdev
nipsysdev deleted the ci/add-filebase-deploy-pinning branch November 20, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants