Skip to content

Commit

Permalink
add auto-deploy workflow
Browse files Browse the repository at this point in the history
hopefully it works. probably not knowing my luck
  • Loading branch information
LBlend committed Oct 23, 2024
1 parent 26e2e75 commit c0200f6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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_ed25519
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519 # This should be redundant but seems to do the trick.
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 && yarn build && exit"

- name: Clean up
run: rm -rf ~/.ssh

0 comments on commit c0200f6

Please sign in to comment.