Deploy Astro on Hetzner with GitHub Actions

🚀 Astro 🇪🇺 Hetzner Cloud ⚙️ GitHub Actions
Generic Template

Configuration Files

Production-ready configuration files with detailed comments and best practices. Each file works together as a complete deployment solution.
name: Deploy Astro to Hetzner

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'npm'
      
      - name: Install dependencies
        run: npm ci
      
      - name: Build
        run: npm run build
      
      - name: Deploy to Hetzner
        run: |
          # Add your Hetzner deployment commands here
          echo "Deploy to Hetzner"

Prerequisites

  • Hetzner account
  • Astro project initialized
  • GitHub repository
  • Node.js 18+ installed

Deployment Steps

  • 1. Create Hetzner account
  • 2. Set up Astro project
  • 3. Configure Hetzner CLI or API credentials
  • 4. Add deployment secrets to GitHub
  • 5. Create .github/workflows/deploy.yml
  • 6. Push to trigger deployment

Additional Notes

  • 🚀 Deploy Astro to Hetzner
  • ⚡ Automated CI/CD with GitHub Actions
  • 🔒 Secure credential management
  • 💡 Customize the deployment script for your needs