add deployment workflow

This commit is contained in:
LBlend committed 2024-02-25 22:14:25 +01:00
1 parent bb6829d127
commit 7962021e0c
1 file changed
+23
+23
View File
@@ -0,0 +1,23 @@
name: Deploy
on:
push:
branches:
- main
jobs:
run_pull:
runs-on: ubuntu-latest
steps:
- name: Set up SSH
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- name: Connect, pull, build and deploy
run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git checkout ${{ secrets.MAIN_BRANCH }} && git pull && docker-compose up -d --build && exit"
- name: Clean up
run: rm -rf ~/.ssh