Home/Solo OPS/GitHub Actions: Automate Your Website Updates — From Push to Live in 30 Seconds
GitHub Actions: Automate Your Website Updates — From Push to Live in 30 Seconds

GitHub Actions: Automate Your Website Updates — From Push to Live in 30 Seconds

A fully automated deployment solution: write an article, git push, and let automation handle the rest.

You know the scenario?

Finish writing an article. Open an FTP client. Log in to the server. Navigate to the site root. Manually upload files. Manually clear the CDN cache.

This takes at least 10 minutes per article. Updating multiple articles or changing configuration? Half an hour easily. And the worst part — sometimes you forget to upload a file and the site breaks.

I dealt with this constantly when I started my content site. Until I spent half a day learning GitHub Actions and automated the entire flow.

Now, from finishing an article to having it live, I do one thing: type git push, hit Enter. Wait 30 seconds, refresh the page — the content is already updated.

From 30 minutes to 30 seconds. A 60× efficiency improvement.

Step 1: What Is GitHub Actions?

GitHub Actions is an automation tool from GitHub. Simply put: a robot running in the cloud.

You give it instructions: "When [event] happens, automatically execute [these actions]." The most common scenario: when I push code to the main branch, automatically install dependencies, build, and deploy to the server.

No manual intervention needed.

Step 2: The Simplest Setup — Vercel Auto-Deploy

If your site is deployed on Vercel, congratulations — this is the easiest option.

Vercel directly integrates with GitHub repos. No YAML configuration needed. Just link your GitHub repo in the Vercel dashboard.

When you push code to GitHub, Vercel automatically: pulls the latest code → installs dependencies → builds → deploys to production.

Configuration takes just a few minutes. Try this first. Experience the feeling of "push, stare at the screen for a few seconds, refresh, and the content is already updated."

Step 3: Advanced — Custom Workflows

If you need more control — code checks, image optimization, notifications before deployment — write your own workflow.

Basic Configuration

Create .github/workflows/deploy.yml in your repository root. Define name, on (trigger conditions), and jobs (the work to execute).

Core steps: checkout code → setup Node.js → install dependencies → build → deploy. Every step should have explicit error handling — no failed builds continuing to deploy.

Code Quality Checks

Add an ESLint step before building. If code format is wrong, the workflow fails. Problematic code never reaches production.

Automatic Image Optimization

Use the sharp library to scan for new images, auto-convert them to WebP format, and compress to under 200KB. This saves bandwidth and improves page load speed.

Content Format Validation

If you write in MDX or Markdown, add a frontmatter validation step. Check every article for required fields (description, slug, etc.). Missing fields trigger a build failure so you can fix them.

Deployment Failure Notifications

If the build fails, send a notification. Feishu, Slack, Discord, email — whatever you prefer.

Step 4: Scheduled Publishing

Sometimes you batch-write articles on the weekend and want to space them out. GitHub Actions' schedule trigger has you covered.

Configure a cron expression in your workflow. For example, auto-publish one article every day at 3 AM. Place pending articles in a specific folder and use a script to move one to the publish directory daily, then commit and push to trigger deployment.

Alternatively, use branch management: write on a draft branch, and use a scheduled task to auto-merge specific content to main.

Step 5: Rollback and Safety

Worried about "every push auto-deploys — what if I push buggy code?"

Don't worry. GitHub Actions supports manual rollback. In Vercel's Dashboard, you can see every deployment's history. One click rolls back to any previous version.

Push with confidence. If something breaks, roll back and fix it.

Step 6: Non-Vercel Deployment

If your site runs on a self-hosted server or cloud VPS, GitHub Actions still works.

In the last step of your workflow, transfer built files to your server via SSH and remotely execute a service restart command. The prerequisite: configure SSH keys or a deployment token in your GitHub repo.

More complex than Vercel integration, but the automation concept is identical.

Step 7: Version History = Peace of Mind

GitHub Actions has an overlooked benefit: your project gets a complete version history.

Every article, every change, every modification is clearly recorded in the Git log. If you accidentally delete a file or change something you shouldn't have, git revert saves you.

Traditional FTP can't do this. Managing content with Git means every action is traceable and reversible.

Step 8: Cost

GitHub Actions' free plan: 2,000 minutes per month. I do roughly 100 deployments per month, each taking about 2 minutes — 200 minutes total, well under the free limit.

Vercel's free plan has no deployment restrictions. The entire automation pipeline costs zero extra.

FAQ

Q: I don't know how to write YAML.

A: Start with Vercel's auto-deploy — no configuration needed. Once comfortable, gradually add GitHub Actions. GitHub's marketplace has many ready-made action templates.

Q: Can I use this with static site generators (Hugo, Astro)?

A: Absolutely. Same principle — build then deploy static files to a server or CDN. GitHub Actions works with any framework.

Q: How do I handle team collaboration?

A: Use branch protection rules — only code that passes PR review can merge to main and trigger deployment.

Q: How do I automate database migrations?

A: Add a migration script step between the build step and the deploy step in your workflow.

Q: Will my site go down if deployment fails?

A: No. Vercel deploys atomically — the new version only replaces the old one after successful deployment. If it fails, the old version stays intact.

Summary

GitHub Actions delivers three core benefits for solo companies:

First, efficiency. From writing to going live takes one git push — all manual steps eliminated.

Second, reliability. Automation runs by fixed rules. Nobody forgets to upload files. Nobody gets woken up at 3 AM to fix a broken server.

Third, traceability. Every change has version records. Roll back anytime.

If you're still deploying manually, spend one hour setting up automated deployment. That hour will save you countless future 30-minute chunks.

Go try it. Push your code, stare at the screen for ten seconds, then refresh — see the content already updated? This feeling is addictive.

SoloOpsAutomation