Skip to content

cd

cd #126

Workflow file for this run

name: cd
on:
workflow_run:
workflows: ["ci"]
types:
- completed
branches:
- 'master'
jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Build Binary
id: build
run: |
cargo build --release
- name: rsync
if: ${{ steps.build.outcome == 'success' }}
uses: contention/[email protected]
with:
flags: -vP
excludes:
user: ${{ secrets.DEPLOY_USERNAME }}
host: ${{ secrets.DEPLOY_HOST }}
localpath: target/release/isac-rs
remotepath: ${{ secrets.DEPLOY_PATH }}
deploy_key: ${{ secrets.DEPLOY_SSH_KEY }}
- name: restart service
if: ${{ steps.build.outcome == 'success' }}
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
script: |
git pull # sync templates
systemctl --user restart isac