From c3530fe2aa960a34688d5637434dfd0f189d7678 Mon Sep 17 00:00:00 2001 From: ValueOn AG Date: Sun, 24 May 2026 02:35:18 +0200 Subject: [PATCH] feat: add int deployment workflow for porta-int-platform-core Co-authored-by: Cursor --- .../workflows/int_porta-int-platform-core.yml | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .forgejo/workflows/int_porta-int-platform-core.yml diff --git a/.forgejo/workflows/int_porta-int-platform-core.yml b/.forgejo/workflows/int_porta-int-platform-core.yml new file mode 100644 index 00000000..33a59b74 --- /dev/null +++ b/.forgejo/workflows/int_porta-int-platform-core.yml @@ -0,0 +1,58 @@ +name: Deploy Plattform-Core (Int) +on: + push: + branches: + - int +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Tests auf Infomaniak VM + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + run: | + mkdir -p ~/.ssh + echo "$SSH_PRIVATE_KEY" > ~/.ssh/deploy_key + chmod 600 ~/.ssh/deploy_key + echo "StrictHostKeyChecking=no" >> ~/.ssh/config + echo "UserKnownHostsFile=/dev/null" >> ~/.ssh/config + ssh -i ~/.ssh/deploy_key ubuntu@api-int.poweron.swiss " + set -e + cd /srv/gateway/current + git remote set-url origin ssh://git@git.poweron.swiss:2222/PowerOn/plattform-core.git + git fetch origin int + git reset --hard origin/int + test -f env-int.env + cp env-int.env .env + rm -f env-dev.env env-int.env env-prod.env + source .venv/bin/activate + pip install -r requirements.txt --no-cache-dir + python -m pytest tests/ --ignore=tests/demo + " + + deploy: + runs-on: ubuntu-latest + needs: test + steps: + - name: Deploy to Infomaniak VM + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + run: | + mkdir -p ~/.ssh + echo "$SSH_PRIVATE_KEY" > ~/.ssh/deploy_key + chmod 600 ~/.ssh/deploy_key + echo "StrictHostKeyChecking=no" >> ~/.ssh/config + echo "UserKnownHostsFile=/dev/null" >> ~/.ssh/config + ssh -i ~/.ssh/deploy_key ubuntu@api-int.poweron.swiss " + set -e + cd /srv/gateway/current + git remote set-url origin ssh://git@git.poweron.swiss:2222/PowerOn/plattform-core.git + git fetch origin int + git reset --hard origin/int + test -f env-int.env + cp env-int.env .env + rm -f env-dev.env env-int.env env-prod.env + source .venv/bin/activate + pip install -r requirements.txt --no-cache-dir + sudo systemctl restart gateway + "