-
-
Save leonson/c937a97ce14aa17f0205c8a7e04ccfc8 to your computer and use it in GitHub Desktop.
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 [email protected]: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> . | |
... |
root as username, my digitalocean password as password
This combination doesn't look right. You want to use user/password you usually use to login the droplet, not the password you login to digitalocean.com
Also it's dangerous to expose root user in first place. You want to create a different unix user (hint: useradd) rather than root to do the work on your Droplet.
You want to use user/password you usually use to login the droplet.
My droplet don't have password. I am using ssh to login my droplet from my local machine. What to use in this case?
@chaudharykiran in this case you either useradd or figure out how to configure your GitHub repo to SSH into your Droplet, like you did on your local machine. appleboy/ssh-action may or may not have option.
What if I don't use Docker? Can I still use this ssh-action tool?
@ahmedsadman yes you can.
I am using Droplet IP address as host, root as username, my digitalocean password as password. But still it is not working. Any hint?