Skip to content

⚠️‼️ deploy_prod → cms-mail-notification-frontend.rundgang.udk-berlin.de #13

⚠️‼️ deploy_prod → cms-mail-notification-frontend.rundgang.udk-berlin.de

⚠️‼️ deploy_prod → cms-mail-notification-frontend.rundgang.udk-berlin.de #13

Workflow file for this run

name: '⚠️‼️ deploy_prod → cms-mail-notification-frontend.rundgang.udk-berlin.de'
on:
#push:
# branches: [ "main" ]
#pull_request:
# branches: [ "main" ]
workflow_dispatch:
inputs:
ref:
description: The branch, tag or SHA to checkout
required: true
default: 'main'
jobs:
deploy_prod:
runs-on: ubuntu-latest
env:
ssh_user: 'root'
ssh_host: 'cms-mail-notification-frontend.rundgang.udk-berlin.de'
ssh_key: ${{ secrets.SSH_RUNDGANG_UDK_BERLIN_DE }}
vite_matrix_server_url: ${{ secrets.VITE_MATRIX_SERVER_URL }}
vite_max_room_age_days: ${{ secrets.VITE_MAX_ROOM_AGE_DAYS }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- run: |
cat > .env << EOF
VITE_MATRIX_SERVER_URL=$vite_matrix_server_url
VITE_MAX_ROOM_AGE_DAYS=$vite_max_room_age_days
EOF
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- run: npm clean-install
- run: npm run build --if-present
- run: mkdir -p ~/.ssh/
- run: echo "$ssh_key" > ~/.ssh/private.key
- run: chmod 600 ~/.ssh/private.key
- run: |
cat > ~/.ssh/config << EOF
Host remote
HostName $ssh_host
User $ssh_user
IdentityFile ~/.ssh/private.key
StrictHostKeyChecking no
EOF
## ssh access is restricted to `rrsync` via remote:~/.ssh/authorized_keys
- name: Run rsync to securely copy the build directory to the remote host
run: |
rsync \
--archive \
--compress \
--delete \
--rsh="ssh -i ~/.ssh/private.key" \
--progress \
--verbose \
dist/ \
remote: