| name | publish-article |
| description | Safe single-article deployment to production. File-by-file only (never wildcards/recursion). Pre-deployment checklist, exact file targeting, post-deployment verification, rollback procedure. |
Publish Article Skill
Overview
Publish Article handles the safe, controlled deployment of a single approved article to production. This is the moment of truth: the article leaves the newsroom and goes live to readers.
Core principle: File-by-file deployment only. Never recursive, never wildcard operations. Never deploy anything except the exact article being published.
This skill ensures:
- No accidental overwrites of other articles
- No deployment of incomplete/unapproved content
- Atomic operations (article either fully deployed or fully rolled back)
- Verification before/after deployment
- Rollback capability if something goes wrong post-publish
Supported Deployment Platforms
| Platform | Protocol | Configuration | Example |
|---|
| Google Cloud Storage (GCS) | gsutil, API | Bucket name, folder structure | gs://news-bucket/articles/2025-04-01-story.html |
| Amazon S3 | aws-cli, API | Bucket name, access key | s3://news-bucket/articles/2025-04-01-story.html |
| Netlify | git push, API, CLI | Deploy key, site ID | Connected to Git repo; deploy on push |
| Vercel | git push, API, CLI | Deploy token, project | Connected to Git repo; auto-deploy |
| WordPress | REST API, WP-CLI | Admin URL, auth token | POST to /wp-json/wp/v2/posts |
| Static Site (SFTP) | SFTP, SCP | Server host, credentials, path | sftp://news@server.com/public_html/articles/ |
| GitHub Pages | git push | Repo name, branch | Commit to gh-pages branch; auto-publish |
Pre-Deployment Checklist
Before the article is deployed, every item must be approved and completed:
Editorial Gate
Technical Gate
Compliance Gate
Backup & Rollback Gate
Pre-Deployment File Integrity Check
Before deployment, verify the article file matches expectations:
HTML/Markup Validation
ls -lh article.html
file -b article.html
wc -l article.html
Image Integrity Check
grep -o 'src="[^"]*"' article.html | sort | uniq
for img in images/*.jpg images/*.png; do ls -lh "$img"; done
Metadata Validation
grep -E '(og:title|og:description|og:image|og:url)' article.html
grep 'canonical' article.html
grep 'application/ld+json' article.html
Deployment Execution
Step 1: Choose Your Platform
Your newsroom has configured deployment for one (or more) of these platforms. Identify which platform hosts the published article:
GCS (Google Cloud Storage):
ls -l article.html
gcloud config set project my-newsroom-project
gsutil cp article.html gs://news-bucket/articles/2025-04-01-story.html
gsutil ls gs://news-bucket/articles/2025-04-01-story.html
S3 (Amazon Web Services):
aws sts get-caller-identity
aws s3 cp article.html s3://news-bucket/articles/2025-04-01-story.html
aws s3 ls s3://news-bucket/articles/2025-04-01-story.html
Static Site (SFTP):
sftp news@server.com << EOF
cd public_html/articles/
put article.html 2025-04-01-story.html
bye
EOF
ssh news@server.com "ls -lh /home/news/public_html/articles/2025-04-01-story.html"
Netlify (Git-based):
git add articles/2025-04-01-story.html
git commit -m "Publish article: [headline]"
git push origin main
WordPress (REST API):
curl -X POST https://newsroom.org/wp-json/wp/v2/posts \
-H "Authorization: Bearer $WP_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Article Title",
"content": "<p>Article content here...</p>",
"status": "publish",
"featured_media": 123
}'
Step 2: Deployment Safety Checks (CRITICAL)
BEFORE you execute deployment, answer these questions:
Red flag: If ANY of the above is "no," STOP. Re-read this section.
Step 3: Execute Deployment
echo "Deploying article: 2025-04-01-story.html | By: alice@newsroom.org | Time: $(date)" >> deploy.log
gsutil cp article.html gs://news-bucket/articles/2025-04-01-story.html
DEPLOY_STATUS=$?
if [ $DEPLOY_STATUS -eq 0 ]; then
echo "Deployment successful"
else
echo "Deployment FAILED (exit code: $DEPLOY_STATUS)"
exit 1
fi
Post-Deployment Verification
Immediately after deployment, verify the article is live and correct:
Step 1: Verify File Deployed
gsutil ls -l gs://news-bucket/articles/2025-04-01-story.html
aws s3 ls s3://news-bucket/articles/ | grep 2025-04-01-story.html
ssh news@server.com "ls -lh /home/news/public_html/articles/2025-04-01-story.html"
Expected output: File exists, size matches original, timestamp is current (within last minute).
Step 2: Verify Article is Accessible
Test from two locations (to verify CDN propagation if applicable):
curl -s -o /dev/null -w "%{http_code}" https://newsroom.org/articles/2025-04-01-story.html
curl -s https://newsroom.org/articles/2025-04-01-story.html | head -20
Step 3: Verify Content Integrity
curl -s https://newsroom.org/articles/2025-04-01-story.html > published.html
diff article.html published.html
Step 4: Verify Metadata
Open the article in a browser and check:
Step 5: Verify Social Metadata
curl -s https://newsroom.org/articles/2025-04-01-story.html | grep -E 'og:(title|description|image|url)'
Step 6: Search Engine Indexing (optional, but check after a few hours)
curl -X POST 'https://www.google.com/ping?sitemap=https://newsroom.org/sitemap.xml'
Rollback Procedure
If post-deployment verification fails, roll back immediately:
Automatic Rollback (if using version control)
git log --oneline | head -5
git revert [commit-hash]
git push origin main
Manual Rollback (GCS/S3)
gsutil rm gs://news-bucket/articles/2025-04-01-story.html
gsutil cp gs://news-bucket/articles-backup/2025-04-01-story.html.bak \
gs://news-bucket/articles/2025-04-01-story.html
aws s3 cp s3://news-bucket/articles-backup/2025-04-01-story.html.bak \
s3://news-bucket/articles/2025-04-01-story.html
Manual Rollback (Static Site / SFTP)
ssh news@server.com "rm /home/news/public_html/articles/2025-04-01-story.html"
scp articles-backup/2025-04-01-story.html.bak news@server.com:/home/news/public_html/articles/2025-04-01-story.html
Manual Rollback (WordPress)
POST_ID=$(curl -s 'https://newsroom.org/wp-json/wp/v2/posts?search=Article%20Title&_fields=id' \
-H "Authorization: Bearer $WP_TOKEN" | jq '.[0].id')
curl -X DELETE https://newsroom.org/wp-json/wp/v2/posts/$POST_ID \
-H "Authorization: Bearer $WP_TOKEN" \
-d '{"force": true}'
Document the Rollback
rollback:
date: "2025-04-01 10:15 AM"
reason: "Images failed to load; metadata incomplete"
by: "alice@newsroom.org"
command: "gsutil rm gs://news-bucket/articles/2025-04-01-story.html"
status: "success"
next_steps: "Re-deploy after fixing image paths"
Common Mistakes & Red Flags
Deployment Mistakes
| Mistake | Why It's Bad | Fix |
|---|
Deploying directory instead of file (gsutil -m cp articles/* gs://bucket/) | May overwrite other articles; creates chaos | Use explicit filename: gsutil cp articles/2025-04-01-story.html gs://bucket/articles/... |
Using wildcard (aws s3 cp *.html s3://bucket/) | Uploads everything in current directory; disaster | Deploy one file at a time; verify path before executing |
| Deploying unapproved version (old draft instead of final) | Wrong content goes live; requires emergency rollback | Triple-check file path and version before deploy command |
| No backup before deploying (no rollback possible) | If something goes wrong, can't recover | Always maintain a pre-deployment backup (version control or manual copy) |
| Deploying incomplete article (missing images, metadata) | Broken page goes live; low user experience | Run pre-deployment checklist; verify all images uploaded |
| Forgetting to update sitemap (article not discoverable in search) | Search engines don't index; no organic traffic | After deployment, update sitemap.xml; ping Google |
Verification Mistakes
| Mistake | Why It's Bad | Fix |
|---|
| Not testing from live URL (only checking local file) | May be cached differently on live server; may not work | Always test via actual published URL; use multiple browsers |
| Assuming deployment succeeded without checking | Article may have failed silently; readers see 404 | Always verify HTTP 200 + content check after deployment |
| Only checking one aspect (images but not metadata) | Metadata missing; social cards don't display | Use full post-deployment checklist (5 steps) |
| Checking immediately after deploy (before CDN propagates) | May see old cached version; false success | Wait 30 seconds; check from 2+ locations; check multiple times |
| Not testing on mobile | Mobile users see broken layout; don't discover problem | Test via mobile browser or responsive view in DevTools |
Rollback Mistakes
| Mistake | Why It's Bad | Fix |
|---|
| Trying to "fix" the live article instead of rolling back | May make it worse; wastes time; better to start over | Roll back immediately; fix offline; redeploy fresh |
| Deleting article without checking if it's still being read | Early readers miss article; confusion; embarrassment | Rollback ASAP; add note to homepage ("Article temporarily removed for updates") |
| Rollback command typed wrong (deletes wrong article) | Deletes innocent article; chaos; reputation damage | Always test rollback command on test data first |
| No rollback procedure documented | When disaster happens, don't know what to do | BEFORE deployment, document and test rollback steps |
Critical Safety Rules
Rule 1: File-by-File Only
NEVER use:
gsutil -m cp articles/* gs://bucket/articles/
aws s3 cp *.html s3://bucket/
sftp news@server << EOF
cd public_html
put -r articles/
EOF
ALWAYS use:
gsutil cp articles/2025-04-01-story.html gs://bucket/articles/2025-04-01-story.html
aws s3 cp articles/2025-04-01-story.html s3://bucket/articles/2025-04-01-story.html
Rule 2: Atomic Deployment (All or Nothing)
Either the article is fully deployed and verified, or it's rolled back. No partial/broken states.
gsutil cp article.html gs://bucket/articles/2025-04-01-story.html
curl -s https://newsroom.org/articles/2025-04-01-story.html | grep -q "Article Title"
if [ $? -ne 0 ]; then
echo "Verification failed. Rolling back..."
gsutil rm gs://bucket/articles/2025-04-01-story.html
exit 1
fi
echo "Deployment and verification successful"
Rule 3: Editorial Approval Before Deployment
DO NOT DEPLOY until all gates are passed:
Deployment Workflow Checklist
Pre-Deployment (30 min before go-live)
Deployment (go-live moment)
Post-Deployment (30 min after go-live)
If Something Goes Wrong
Escrow & Collaboration
If article is collaborative (multiple reporters, editors):
- One person owns deployment (prevent multiple deployments of same article)
- Deployment approver is editor (signs off on checklist)
- Deployment executor is tech/manager (actually runs commands)
- Rollback authority is editor (decides to roll back if issues arise)
Communication protocol:
Reporter Alice: "Article ready for deployment checklist"
Editor Bob: "Approved. Running checklist... ✓ All items complete. Deploying at 9:00 AM."
Tech Manager Carol: "Confirmed. Standing by for verification."
[Deployment at 9:00 AM]
Carol: "Article deployed. Running verification... ✓ All checks pass. Live!"
Bob: "Confirmed. Article is live. Notifying social team."
Escalation
If deployment fails or article has issues post-publication:
- Editors: Decide whether to roll back or push forward
- Tech: Executes rollback or deployment fix
- Communications: Update homepage/social if article is pulled
- Legal (if needed): Review article for liability if corrections posted