chore: Update workflows #27
Workflow file for this run
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
on: | |
push: | |
tags: | |
- '*' | |
name: Release | |
jobs: | |
test: | |
name: Test Suite | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Install rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Test app | |
env: | |
STABIL_API_TEST_USERNAME: ${{ secrets.STABIL_API_TEST_USERNAME }} | |
STABIL_API_TEST_PASSWORD: ${{ secrets.STABIL_API_TEST_PASSWORD }} | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
redeploy: | |
name: Redeploy app | |
runs-on: ubuntu-latest | |
needs: [test] | |
steps: | |
- name: Restart service via SSH | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
script_stop: true | |
script: | | |
cd stabil-api | |
git fetch --all | |
git reset --hard origin/main | |
git pull | |
$HOME/.cargo/bin/cargo install --path . | |
sudo systemctl restart stabil-api | |
sudo systemctl status stabil-api |