Skip to content

Instantly share code, notes, and snippets.

@leonson
Created July 19, 2020 04:06
Show Gist options
  • Save leonson/c937a97ce14aa17f0205c8a7e04ccfc8 to your computer and use it in GitHub Desktop.
Save leonson/c937a97ce14aa17f0205c8a7e04ccfc8 to your computer and use it in GitHub Desktop.
Sample Workflow
on:
push:
branches:
- master
jobs:
deploy-to-digital-ocean-droplet:
runs-on: ubuntu-latest
name: Deploy Website
steps:
- name: Checkout master
uses: actions/checkout@master
- name: Pull from GitHub
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_IP }}
username: ${{ secrets.HOST_USERNAME }}
password: ${{ secrets.HOST_PASSWORD }}
script: cd ~/path/to/project && git pull git@github.com:project/home.git
- name: Docker Build
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_IP }}
username: ${{ secrets.HOST_USERNAME }}
password: ${{ secrets.HOST_PASSWORD }}
script: cd ~/path/to/project && docker built -t <container> .
...
@ahmedsadman
Copy link

What if I don't use Docker? Can I still use this ssh-action tool?

@leonson
Copy link
Author

leonson commented Aug 26, 2020

@ahmedsadman yes you can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment