mmk2410.org/.forgejo/workflows/deploy.yml
Marcel Kapfer 11ffc370c2
All checks were successful
Deploy / deploy (push) Successful in 5s
💚 Fix wrong path to deploy script
2024-03-17 23:01:44 +01:00

37 lines
993 B
YAML

name: Deploy
on:
push:
branches:
- kirby
jobs:
deploy:
runs-on: docker
container:
image: alpine:3.19
steps:
- name: Install packages
run: apk add --no-cache openssh
- name: Add SSH key
run: |
mkdir ~/.ssh
chmod 700 ~/.ssh
echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
echo "$SSH_KNOWN_HOSTS" | tr -d '\r' >> ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
env:
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}}
- name: Run deploy script on server
run: |
ssh -p "$SSH_PORT" "$SSH_USER"@"$SSH_HOST" \
"cd /var/www/dev.mmk2410.org && ./deploy.sh $BRANCH"
env:
SSH_USER: ${{secrets.SSH_USER}}
SSH_HOST: ${{secrets.SSH_HOST}}
SSH_PORT: ${{secrets.SSH_PORT}}
BRANCH: ${{vars.BRANCH}}