Skip to content

Merge pull request #2 from SentioProberDev/cynthia-update_new_deploy_… #6

Merge pull request #2 from SentioProberDev/cynthia-update_new_deploy_…

Merge pull request #2 from SentioProberDev/cynthia-update_new_deploy_… #6

Workflow file for this run

name: Deploy Website
on:
push:
branches: ["main"]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare incoming dir
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
port: ${{ secrets.DEPLOY_PORT }}
script: |
set -e
mkdir -p "${{ secrets.DEPLOY_PATH }}/.incoming"
- name: Rsync upload to incoming
uses: burnett01/rsync-deployments@7.0.1
with:
switches: -avzr --delete --exclude='.git/' --exclude='.github/' --exclude='.incoming/'
path: ./
remote_path: ${{ secrets.DEPLOY_PATH }}/.incoming/
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_KEY }}
remote_port: ${{ secrets.DEPLOY_PORT }}
- name: Swap into live
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
port: ${{ secrets.DEPLOY_PORT }}
script: |
set -e
TARGET="${{ secrets.DEPLOY_PATH }}"
rsync -a --delete --exclude='.incoming/' "$TARGET/.incoming/" "$TARGET/"
rm -rf "$TARGET/.incoming"