Skip to content

Instantly share code, notes, and snippets.

@jorgeacortes
Last active March 18, 2021 18:47
Show Gist options
  • Save jorgeacortes/4183587726598313fa999443f163b9ba to your computer and use it in GitHub Desktop.
Save jorgeacortes/4183587726598313fa999443f163b9ba to your computer and use it in GitHub Desktop.
Github actions autodeploy to a server via ssh when pushing to master
name: CI
on: [push]
jobs:
deploy:
if: github.ref == 'refs/heads/master'
runs-on: [ubuntu-latest]
steps:
- name: Push to server
- uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
script: cd project && ./deploy.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment