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 ( dl.mrinal.xyz/x/ ) | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
deploy: | |
name: Deploying | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setting up SSH Key | |
run: | | |
mkdir -p ~/.ssh/ | |
eval "$(ssh-agent -s)" | |
echo "${{ secrets.SRV_PVT_KEY }}" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
ssh-keyscan ${{ secrets.DL_HOST }} >> ~/.ssh/known_hosts | |
chmod 644 ~/.ssh/known_hosts | |
- name: Deploy to server | |
run: | | |
rsync -avz --delete --exclude '.git' --exclude '.github' --exclude 'README.md' --exclude 'LICENSE' --exclude '.gitignore' --exclude 'deploy.yml' --exclude 'hosted_files.ngix' . ${{ secrets.HOST_USERNAME }}@${{ secrets.DL_HOST }}:/srv/hosted_files/x/ |