Skip to content

Instantly share code, notes, and snippets.

@Sasha-hk
Created April 16, 2022 14:15
Show Gist options
  • Save Sasha-hk/d98193e3d01924c518dd66fde01efa8d to your computer and use it in GitHub Desktop.
Save Sasha-hk/d98193e3d01924c518dd66fde01efa8d to your computer and use it in GitHub Desktop.

GitHub Actions continuous deployment workflow

Workflow config:

name: CD

on:
  push:
    branches:
      - main  

jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the repo
        uses: actions/checkout@v2

      - name: Deploy on VPS
        uses: appleboy/ssh-action@master
        with:
          host: ${{ secrets.SSH_HOST }}
          username: ${{ secrets.SSH_USERNAME }}
          key: ${{ secrets.SSH_KEY }}
          script: |
            git pull
            echo "Make something..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment