Skip to content

Cleanup (#578)

Cleanup (#578) #210

# SPDX-License-Identifier: AGPL-3.0-or-later
# SPDX-FileCopyrightText: 2021 Moritz Hedtke <[email protected]>
name: Deployment
concurrency: staging
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deployment:
runs-on: ubuntu-latest
environment:
name: staging
url: https://staging-aes.selfmade4u.de/
steps:
- name: Setup SSH
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
echo "${{ secrets.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
- name: SSH
run: |
set -ex
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
echo $GIT_BRANCH
ssh [email protected] -p 2121 << EOF
set -ex
cd /opt/projektwahl-lit-staging/
git fetch --prune origin
git checkout origin/$GIT_BRANCH
npm ci
LANGUAGE=de npm run build
sudo systemctl stop [email protected]
EOF