add dev workflow for building and deploying backend and frontend
Some checks failed
Dev Build / build-test (push) Has been cancelled
Dev Build / deploy-dev (push) Has been cancelled

This commit is contained in:
Joshua King
2026-04-26 11:51:31 -04:00
parent 230c3b295d
commit 458fc9a4e1

50
.gitea/workflows/dev.yml Normal file
View File

@@ -0,0 +1,50 @@
name: Dev Build
on:
pull_request:
branches: [dev]
push:
branches: [dev]
jobs:
build-test:
runs-on: ubuntu-dotnet
steps:
- uses: actions/checkout@v4
- name: Restore backend
run: dotnet restore
- name: Build backend
run: dotnet build --no-restore --configuration Release
- name: Test backend
run: dotnet test --no-build --configuration Release
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "24"
- name: Install frontend deps
run: npm ci
working-directory: ./frontend
- name: Build frontend
run: npm run build
working-directory: ./frontend
deploy-dev:
needs: build-test
if: gitea.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Deploy dev
run: |
echo "${{ secrets.DEV_DEPLOY_SSH_KEY }}" > /tmp/dev_key
chmod 600 /tmp/dev_key
ssh -i /tmp/dev_key -o StrictHostKeyChecking=no \
${{ secrets.DEV_DEPLOY_USER }}@${{ secrets.DEV_DEPLOY_HOST }} \
"${{ secrets.DEV_DEPLOY_PATH }}/deploy.sh"