Created
July 19, 2020 04:06
-
-
Save leonson/c937a97ce14aa17f0205c8a7e04ccfc8 to your computer and use it in GitHub Desktop.
Sample Workflow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> . | |
... |
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.