updated deployment file and env file
All checks were successful
Deploy Nyla Frontend / build-and-deploy (push) Successful in 10m33s
All checks were successful
Deploy Nyla Frontend / build-and-deploy (push) Successful in 10m33s
This commit is contained in:
parent
86a3ac647c
commit
234ffa7896
2 changed files with 56 additions and 0 deletions
50
.forgejo/workflows/deploy-int.yml
Normal file
50
.forgejo/workflows/deploy-int.yml
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
name: Deploy Nyla Frontend INT
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- int
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Copy environment file
|
||||
run: cp config/env-poweron-nyla-int.env .env
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build React app
|
||||
run: npm run build
|
||||
|
||||
- name: Deploy to Infomaniak VM
|
||||
env:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
run: |
|
||||
apt-get update && apt-get install -y rsync
|
||||
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
|
||||
rsync -az --delete \
|
||||
-e "ssh -i ~/.ssh/deploy_key" \
|
||||
./dist/ \
|
||||
ubuntu@porta-int.poweron.swiss:/srv/nyla/current/dist/
|
||||
ssh -i ~/.ssh/deploy_key ubuntu@porta-int.poweron.swiss \
|
||||
"sudo systemctl reload nginx"
|
||||
6
config/env-porta-int.env
Normal file
6
config/env-porta-int.env
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# Environment: porta (Forgejo deploy → porta.poweron.swiss)
|
||||
# Consumed by: Vite build + SPA runtime (getApiBaseUrl / getAppName)
|
||||
# Auth and secrets live on the gateway — never in frontend env.
|
||||
|
||||
VITE_API_BASE_URL=https://api-int.poweron.swiss
|
||||
VITE_APP_NAME=PORTA
|
||||
Loading…
Reference in a new issue