Deploy MQTT test backend with private viewer and Gitea CI/CD
Test and deploy MQTT backend / test (push) Successful in 2m8s
Test and deploy MQTT backend / deploy (push) Successful in 18s

This commit is contained in:
2026-10-08 14:48:53 +03:30
commit 71ef622b4f
70 changed files with 7123 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
name: Test and deploy MQTT backend
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: mqtt5-test-backend
cancel-in-progress: false
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Unit tests and vet (no private broker credentials)
run: docker build --target test -t mqtt5-test-backend-ci:${{ gitea.sha }} .
deploy:
needs: test
if: gitea.event_name != 'pull_request' && gitea.ref == 'refs/heads/main'
runs-on: ubuntu-latest
container:
volumes:
- /opt/test-mqtt-5/backend:/runtime
steps:
- uses: actions/checkout@v4
- name: Build and deploy on the existing server Docker daemon
env:
COMMIT_SHA: ${{ gitea.sha }}
MQTT5_RUNTIME: /runtime
run: |
set -eu
TAG="$(date -u +%Y-%m-%d_%H-%M-%S)-$(printf '%s' "$COMMIT_SHA" | cut -c1-12)"
docker build -t "mqtt5-test-backend:$TAG" .
sh server/deploy.sh "$TAG"