Deployment #717
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: Deployment | |
on: | |
workflow_run: | |
workflows: [ "Rust CI" ] | |
branches: [ main ] | |
types: | |
- completed | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build_and_deploy: | |
runs-on: self-hosted | |
environment: intelli | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Update Dependencies | |
run: cargo update | |
- name: Build the Project | |
run: cargo build --release | |
- name: Deploy to Server | |
run: | | |
# Stop the running service | |
sudo systemctl stop intelli-api | |
# Copy the new binary to the deployment directory | |
mv target/release/api /home/fedora/deployments/intelli-api/intelli-api | |
# Start the service | |
sudo systemctl start intelli-api |