DEV Community

Cover image for How I Automated My Workflow With GitHub Actions (Agency-Level Setup in Minutes)
Pixel Mosaic
Pixel Mosaic

Posted on

How I Automated My Workflow With GitHub Actions (Agency-Level Setup in Minutes)

When I automated my development workflow with GitHub Actions, everything became smoother—no more manual builds, missed tests, or stressful deployments. The same setup now powers several design agency pipelines because it’s simple, reliable, and easy to scale.

This guide gives you a fast explanation of the setup AND the full CI/CD workflow file you can paste directly into your repository.

Why Automate?

  • Faster, consistent builds
  • Automatic testing
  • Zero-click deployments
  • Fewer human mistakes
  • A clean, professional workflow used by agencies

GitHub Actions runs your pipeline every time you push or open a pull request.

Quick Setup (3 Steps)

1. Create the workflow file

Create:
.github/workflows/ci.yml

2. Add your secrets

GitHub → Repo → Settings → Secrets → Actions

Add:

  • VERCEL_TOKEN (or Netlify tokens if you deploy there)

3. Paste the workflow below

This automates install → test → build → deploy.

FULL WORKFLOW (COPY-PASTE READY)

name: CI/CD Pipeline

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

steps:

  • name: Checkout repository
    uses: actions/checkout@v4

  • name: Setup Node.js
    uses: actions/setup-node@v4
    with:
    node-version: '18'
    cache: 'npm'

  • name: Install dependencies
    run: npm install

  • name: Run tests
    run: npm test

  • name: Build project
    run: npm run build

  • name: Deploy to Vercel
    run: npx vercel --prod --yes
    env:
    VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}

Enter fullscreen mode Exit fullscreen mode




Best Practices

  • Use main for production and dev for staging
  • Add npm run lint to keep code clean
  • Use GitHub Secrets for all tokens
  • Cache dependencies for faster CI
  • Document your pipeline for teammates

Conclusion

This simple GitHub Actions setup gives you a professional, agency-grade automation pipeline. Once you enable it, deployments become automatic and your workflow becomes far more efficient and reliable.

Tags

githubactions #automation #cicd #webdev #devops

Top comments (0)