Skip to content

Instantly share code, notes, and snippets.

@prashantdsala
Created July 25, 2024 14:22
Show Gist options
  • Save prashantdsala/5d4f204548455401483321946d4838a7 to your computer and use it in GitHub Desktop.
Save prashantdsala/5d4f204548455401483321946d4838a7 to your computer and use it in GitHub Desktop.
Github actions "deploy" part steps
# copy public key into authrized keys file: cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
# chmod 600 ~/.ssh/authorized_keys
# create secrets in repo settings actions page.
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: out
- name: Display structure of downloaded files
run: ls -R out
- name: Deploy to my server
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} # Private key .ssh/id_rsa
ARGS: "-rltDzvO --delete"
SOURCE: "out"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }} # Public IP address of the system
REMOTE_USER: ${{ secrets.REMOTE_USER }} # user of the system with which we will perform the ssh
TARGET: ${{ secrets.REMOTE_DEVELOP_TARGET }} # Complete directory path where to copy the folder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment