platform-core/.forgejo/workflows/deploy.yml
Ida 76cb841973
Some checks failed
Deploy Plattform-Core / test (push) Failing after 3s
Deploy Plattform-Core / deploy (push) Has been skipped
fix: test job in deployment file
2026-05-20 12:14:50 +02:00

44 lines
No EOL
1.3 KiB
YAML

name: Deploy Plattform-Core
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Dependencies installieren
run: |
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt --no-cache-dir
- name: Tests ausführen
run: .venv/bin/pytest tests/ -v
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.poweron.swiss "
cd /srv/gateway/current &&
git remote set-url origin ssh://git@git.poweron.swiss:2222/PowerOn/plattform-core.git &&
git pull &&
cp env-gateway-prod-forgejo.env .env &&
rm -f env-*.env &&
source .venv/bin/activate &&
pip install -r requirements.txt --no-cache-dir &&
sudo systemctl restart gateway
"