ci: deploy to linode #12
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
name: Deploy to Linode via SSH | |
on: | |
push: | |
branches: | |
- main # Change to your main branch name | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' # Clone submodules | |
- name: Set up SSH | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Copy files to Linode | |
run: | | |
scp -r ${GITHUB_WORKSPACE}${{ secrets.USER }}@${{ secrets.LINODE_IP }}:${{ secrets.PATH_TO_SAVE }} | |
ssh ${{ secrets.USER }}@${{ secrets.LINODE_IP }} 'cd /home/ferran/refuapp && docker-compose pull && docker-compose up -d' | |