Przejdź do treści
Biblioteka skilli
DevOps i chmura · Automatyzacja

cf-page

/cf-page

Wdraża statyczną stronę (plik HTML lub folder) na Cloudflare Pages lokalnie przez wrangler oraz w potoku CI/CD GitHub Actions z zaszyfrowanymi sekretami repozytorium.

Repozytorium
dotfiles ↗
Licencja
MIT
Ostatnia zmiana repozytorium
10.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
3
Skrypty
1
Komentarze HTML
0
Adresy URL w SKILL.md
5
Przestarzałość

Brak sygnałów. Repozytorium zmienione 10.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co sprawdzić przed instalacją
  • 1 skrypt w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: scripts/deploy.sh

Co robi i kiedy

Wdraża statyczną stronę (plik HTML lub folder) na Cloudflare Pages lokalnie przez wrangler oraz w potoku CI/CD GitHub Actions z zaszyfrowanymi sekretami repozytorium.

Wyzwalacze z opisu

wrangler pagesdeploy to cloudflarecf-page
Oryginalny opis (EN)

Deploys a static site (a single HTML file or a folder) to Cloudflare Pages — both a one-command local wrangler deploy and a GitHub Actions CI/CD pipeline — wiring up .env/.env.example and encrypted repo secrets. Use when the user wants to publish or deploy a static site or HTML to Cloudflare Pages, set up CF Pages CI/CD, mentions "wrangler pages" or "deploy to cloudflare", or asks for "cf-page".

Jak działa

  1. The one thing the user must do — creating the token
  2. Prerequisites
  3. Setup checklist
  4. .env.example — commit this
  5. .env — create locally, never commit
  6. .gitignore — ensure these lines
  7. Local deploy
  8. CI/CD (GitHub Actions)
  9. Safety — do not skip
Sekcje z nagłówków SKILL.md, w oryginale · 87 linii, 543 słów
Podgląd SKILL.md
---
name: cf-page
description: Deploys a static site (a single HTML file or a folder) to Cloudflare Pages — both a one-command local wrangler deploy and a GitHub Actions CI/CD pipeline — wiring up .env/.env.example and encrypted repo secrets. Use when the user wants to publish or deploy a static site or HTML to Cloudflare Pages, set up CF Pages CI/CD, mentions "wrangler pages" or "deploy to cloudflare", or asks for "cf-page".
---

# Cloudflare Pages deploy (cf-page)

Ship a static site to Cloudflare Pages two ways from one setup: `./deploy.sh` locally, and GitHub Actions on every push to `main`. Credentials live in `.env` (gitignored); only `.env.example` is committed.

## The one thing the user must do — creating the token

The API token is the only manual step. Tell the user explicitly and link it:

> **Open https://dash.cloudflare.com/profile/api-tokens → "Create Token" → pick the "Cloudflare Pages" template (Edit) → Continue to summary → Create Token → copy it.**

Then they paste it into `.env` (see below). Everything else — account ID, project creation, deploy, CI secrets — is automated.

## Prerequisites

- `gh` authenticated (`gh auth status`) — for creating the repo and setting CI secrets.
- `wrangler` via `npx --yes wrangler@4` — no install needed.
- Account ID: `npx wrangler whoami` prints it if the user has run `wrangler login`; otherwise it is on the dashboard (Workers & Pages → right sidebar). Account ID is **not** secret.
- The site is static: a folder with an `index.html` at its served root. Cloudflare Pages serves it directly — no build step.

## Setup checklist

1. Choose a **project name** — becomes `https://<name>.pages.dev` (globally unique).
2. Add `.env.example` (committed) and `.env` (gitignored) — templates below.
3. Fix `.gitignore` — ignore `.env` and `.env.*`, keep `!.env.example`, ignore `dist/` and `.wrangler/`.
4. Get the token (link above) → paste into `.env`. Get account ID (`npx wrangler whoami`) → paste into `.env`.
5. **Local deploy:** copy `scripts/deploy.sh` into the repo, `chmod +x`, run it.
6. **CI/CD:** add the workflow and set two repo secrets — see [references/github-actions.md](references/github-actions.md).
7. **Verify:** `curl -sI https://<project>.pages.dev/`.

## .env.example — commit this

```sh
# Cloudflare Pages credentials. Copy to .env and fill in. .env is gitignored.
# Token: https://dash.cloudflare.com/profile/api-tokens  ("Cloudflare Pages" template)
CLOUDFLARE_API_TOKEN=
# Account ID: run `npx wrangler whoami`
CLOUDFLARE_ACCOUNT_ID=
# Pages project name  ->  https://<name>.pages.dev
CF_PAGES_PROJECT=my-site
# Optional: directory to deploy (default .) and production branch (default main)
# CF_PAGES_DIR=.
# CF_PAGES_BRANCH=main
```

## .env — create locally, never commit

```sh
CLOUDFLARE_API_TOKEN=          # user pastes the token here
CLOUDFLARE_ACCOUNT_ID=         # from `npx wrangler whoami`
CF_PAGES_PROJECT=my-site
```

## .gitignore — ensure these lines

```gitignore
.env
.env.*
!.env.example
dist/
.wrangler/
```

The `!.env.example` line is essential — `.env.*` would otherwise hide the example you want committed.

## Local deploy

Copy `scripts/deploy.sh` into the repo (e.g. `tools/deploy.sh`), then:

```bash
chmod +x tools/deploy.sh
./tools/deploy.sh                 # deploys $CF_PAGES_DIR (default .) as $CF_PAGES_PROJECT
```

It sources `.env`, creates the Pages project on first run (ignoring "already exists"), and deploys with wrangler. If `.env` has no token but the user ran `wrangler login`, it falls back to that OAuth session.

## CI/CD (GitHub Actions)

Push to `main` → assemble the site → `wrangler pages deploy`. Full workflow YAML and the two `gh secret set` commands: **[references/github-actions.md](references/github-actions.md)**. Requires repo secrets `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID`.

## Safety — do not skip

- **Never commit `.env`.** Confirm `git check-ignore .env` prints `.env`. Before committing, guard: `git diff --cached --name-only | grep -qx .env` must find nothing.
- **Never print the token.** Set secrets via a variable piped to stdin, never echo the value:
  `printf '%s' "$CLOUDFLARE_API_TOKEN" | gh secret set CLOUDFLARE_API_TOKEN`.
- Account ID may be shared freely; the API token may not.
Pliki w paczce (3)
  • SKILL.md 4 KB
  • references/github-actions.md 3 KB
  • scripts/deploy.sh 2 KB

Wersje

W bazie nie ma innych skilli o nazwie cf-page.

Migawka bazy z 13.11.2026 · wersja paczki e53284b09940 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 2 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 95Cloudflare
    Wdraża i zarządza Cloudflare Workers i Pages: zapytania API przez MCP, a wdrożenia przez wrangler.
  • 100cf-pages-deploy
    Wdraża stronę statyczną do Cloudflare Pages bez plików tajnych, sprawdza sekrety i potwierdza, że plik jest identyczny na żywo.
  • 100cloudflare-drop
    Publikuje statyczną stronę z folderu HTML, CSS, JS, obrazów i fontów na Cloudflare i zwraca działający link do udostępnienia, jednym pakietowym poleceniem opartym na Wrangler.
  • 100wrangler
    Wdraża i zarządza Cloudflare Workers, Pages, R2, D1 i KV za pomocą narzędzia wrangler, także przy wdrożeniach na edge.
  • 90GitHub Pages
    Publikuje statyczną stronę, folder HTML/CSS/JS lub dokumentację na GitHub Pages, w tym workflow wdrożeniowy.
  • 100cloudflare-deployment
    Wdraża i zarządza Cloudflare Workers, Pages, KV, R2 i D1 przez wrangler CLI lub serwer MCP.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.