Automate Deployments with GitHub Actions

You're probably deploying manually. Here's how to stop. GitHub Actions gives you free CI/CD directly in your GitHub repo — no external services needed. Here's a complete workflow that runs on every push to main: ```yaml name: Deploy on: push: branches: [main] jobs: test-and-deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version: '20' - run: npm install - run: npm test - name: Deploy to server run: | ssh user@yourserver 'cd /app && git pull && npm install && pm2 restart app' ``` Every push to main: 1. Checks out the code 2. Installs dependencies 3. Runs tests 4. Deploys to your server — only if tests pass Free for public repos. 2,000 minutes/month free for private repos. Stop deploying manually. Set this up once. Never think about it again. Link in bio — starter workflow files for Node, Python, and Docker deployments. #GitHubActions #CICD #DevOps #Automation #TechFinSpecial

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories