30 lines
923 B
YAML
30 lines
923 B
YAML
name: Build and Deploy API
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'finnow-api/**'
|
|
- '.gitea/workflows/api.yaml'
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-ons: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dlang-community/setup-dlang@v2
|
|
with:
|
|
compiler: ldc-latest
|
|
- name: Build
|
|
run: dub build --build=release
|
|
working-directory: ./finnow-api
|
|
- name: Install SSH Key
|
|
uses: shimataro/ssh-key-action@v2
|
|
with:
|
|
key: ${{ secrets.DEPLOY_KEY }}
|
|
known_hosts: ${{ secrets.SSH_HOST }}
|
|
- name: Setup rsync
|
|
uses: GuillaumeFalourd/setup-rsync@v1.2
|
|
- name: Upload API Executable
|
|
run: rsync -avz -e ssh --delete finnow-api root@andrewlalis.com:/opt/finnow/finnow-api
|
|
working-directory: ./finnow-api
|
|
- name: Restart API
|
|
run: ssh -f root@andrewlalis.com 'systemctl restart finnow-api.service'
|