Skip to content

Commit af34fc2

Browse files
author
Lu Wilson
committed
improve deployment guidance
1 parent b90ddbf commit af34fc2

1 file changed

Lines changed: 57 additions & 8 deletions

File tree

.agents/skills/protowiki-deploy/SKILL.md

Lines changed: 57 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@ Do **not** use the Pages option labeled **“GitHub Actions”** for this repo
8282
previews deploy to the `gh-pages` branch via
8383
[`rossjrw/pr-preview-action`](https://github.com/rossjrw/pr-preview-action).
8484

85-
After the first successful `deploy.yml` run on `main`, the `gh-pages` branch
86-
exists; then switch Pages to deploy from that branch.
85+
**Order for a new repo:** enable Actions permissions → push (or merge) to
86+
`main` once so `deploy.yml` creates `gh-pages` → set Pages to **Deploy from a
87+
branch** as above. Until `gh-pages` exists, that branch will not appear in the
88+
Pages dropdown.
8789

8890
## Production deploy
8991

@@ -134,6 +136,10 @@ server-side SPA rewrite on GitHub Pages).
134136
Use this three-way decision:
135137

136138
1. **Template/new repo (default):**
139+
- If the user does **not** have write access to `wikimedia/ProtoWiki`, tell
140+
them to click **Use this template** on `wikimedia/ProtoWiki` (instead of
141+
creating a brand-new repo from scratch).
142+
- Ask for the URL of their template copy, then deploy there.
137143
- Push to `main` for production deploy.
138144
- For preview links, push your changes to a **separate branch** and open a
139145
pull request from that branch to `main` in the same repo
@@ -153,22 +159,65 @@ At deploy time, always declare capability mode first:
153159

154160
Then run:
155161

156-
1. Confirm destination repo (`your copy` by default; upstream only if requested and permitted).
157-
2. Confirm deploy intent:
162+
1. Find the current state:
163+
- Does the user have write access to `wikimedia/ProtoWiki`?
164+
- If not, are they already in a template copy repo?
165+
2. Confirm destination repo (`your copy` by default; upstream only if requested and permitted).
166+
- If the user lacks upstream write access and has no copy yet, instruct them
167+
to create one via **Use this template** on `wikimedia/ProtoWiki`, then ask
168+
for that repo URL and proceed there.
169+
- Prefer this route over asking users to create/configure a brand-new repo manually.
170+
3. Confirm deploy intent:
158171
- `main` push for production update, or
159172
- separate branch + pull request for preview.
160173
- Never use a direct `main` push when the user asked for a preview link.
161-
3. Check prerequisites:
174+
4. Check prerequisites:
162175
- repo exists,
163176
- Actions workflow permissions are read/write,
164-
- Pages source is `gh-pages` branch root.
165-
4. Execute (automated) or provide one copy/paste command block at a time (guided).
166-
5. Return final URL(s): production and/or PR preview.
177+
- Pages source is **Deploy from a branch**`gh-pages` / **/ (root)** (not
178+
“GitHub Actions”).
179+
5. Execute (automated) or provide one copy/paste command block at a time (guided).
180+
6. Return final URL(s): production and/or PR preview.
181+
182+
**When guiding users, include the one-time setup** (below) if any of these apply:
183+
the repo was not created from the ProtoWiki template, the user has never deployed before, Pages is
184+
still on the default source, workflows succeed but the public URL 404s, or PR
185+
preview comments appear but preview URLs 404. Skip repeating it once the user
186+
confirms Pages already uses `gh-pages` at root.
187+
188+
### Guided mode: one-time GitHub setup (give users these steps)
189+
190+
Use plain language. One step at a time; ask the user to confirm before the next.
191+
192+
1. **Workflow permissions** — In the repo on GitHub: **Settings****Actions**
193+
**General****Workflow permissions** → choose **Read and write
194+
permissions****Save**.
195+
2. **First production deploy** — Push or merge to `main` (or walk them through
196+
their first commit to `main`). In **Actions**, wait until **Deploy to GitHub
197+
Pages** finishes successfully. That run creates the `gh-pages` branch.
198+
3. **GitHub Pages source****Settings****Pages**:
199+
- Under **Build and deployment**, **Source**: **Deploy from a branch** (not
200+
“GitHub Actions”).
201+
- **Branch**: `gh-pages`, folder **/ (root)****Save**.
202+
- If `gh-pages` is missing, go back to step 2 and wait for the workflow.
203+
4. **Check the live site** — Open
204+
`https://<username>.github.io/<repo-name>/` (match repo name casing). It can
205+
take a minute after saving Pages settings.
206+
207+
**Do not** tell users to pick **GitHub Actions** as the Pages source — CI still
208+
writes files to `gh-pages`; previews depend on that branch layout.
209+
210+
For pull request previews, the same Pages setup applies; after step 3, open a
211+
pull request and use the preview link from the bot comment (under
212+
`…/pr-preview/pr-<number>/`).
167213

168214
### Guided mode communication style (non-technical users)
169215

170216
When guiding designers/PMs, prefer plain language over Git jargon:
171217

218+
- On first deploy (or if the site 404s after a green workflow), walk through
219+
[Guided mode: one-time GitHub setup](#guided-mode-one-time-github-setup-give-users-these-steps)
220+
before debugging build flags or base paths.
172221
- Say "your project copy" instead of "fork/upstream remote" unless needed.
173222
- Say "make a new branch to test an idea" instead of "create a feature branch".
174223
- Always say "pull request" in full (do not shorten to "PR").

0 commit comments

Comments
 (0)