feat: prepare federated Gitea actions workflow
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
name: Deploy CV Site (andreknie.de)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install & Build Frontend
|
||||
run: |
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
- name: Copy project files to VM
|
||||
uses: appleboy/scp-action@v0.1.7
|
||||
with:
|
||||
host: ${{ secrets.DEPLOY_SSH_HOST }}
|
||||
username: ${{ secrets.DEPLOY_SSH_USER }}
|
||||
key: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||
source: "*"
|
||||
target: "/opt/orchestrator/privat/CV/andreknie.de"
|
||||
|
||||
- name: Execute Deployment on VM
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
with:
|
||||
host: ${{ secrets.DEPLOY_SSH_HOST }}
|
||||
username: ${{ secrets.DEPLOY_SSH_USER }}
|
||||
key: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||
script: |
|
||||
cd /opt/orchestrator/privat/CV/andreknie.de
|
||||
|
||||
# 1. Sichere .env aus den Gitea Secrets generieren
|
||||
cat <<EOF > .env
|
||||
PORT=3003
|
||||
NODE_ENV=production
|
||||
BASE_URL=https://andreknie.de
|
||||
SMTP_HOST=smtp.ionos.de
|
||||
SMTP_PORT=587
|
||||
SMTP_USER=${{ secrets.SMTP_USER }}
|
||||
SMTP_PASS=${{ secrets.SMTP_PASS }}
|
||||
STAKEHOLDER_EMAIL=kontakt@d-hive.de
|
||||
|
||||
DATABASE_URL=postgresql://umami:${{ secrets.UMAMI_DB_PASS }}@umami-db:5432/umami
|
||||
POSTGRES_DB=umami
|
||||
POSTGRES_USER=umami
|
||||
POSTGRES_PASSWORD=${{ secrets.UMAMI_DB_PASS }}
|
||||
HASH_SALT=${{ secrets.UMAMI_HASH_SALT }}
|
||||
EOF
|
||||
|
||||
# 2. Frontend-Build in den Caddy-Ordner verschieben
|
||||
mkdir -p site
|
||||
cp -r dist/* site/
|
||||
|
||||
# 3. Docker Container neustarten
|
||||
docker compose up -d --build
|
||||
Reference in New Issue
Block a user