feat: add int deployment workflow for porta-int-platform-core
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
2cfbb41cdf
commit
c3530fe2aa
1 changed files with 58 additions and 0 deletions
58
.forgejo/workflows/int_porta-int-platform-core.yml
Normal file
58
.forgejo/workflows/int_porta-int-platform-core.yml
Normal file
|
|
@ -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
|
||||
"
|
||||
Loading…
Reference in a new issue