From 0c4ee2d46259928154b3ad2acaf3f36f17eff295 Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Tue, 8 Jul 2025 17:23:45 +0100 Subject: [PATCH] fix: forgejo deploy - please work --- .forgejo/workflows/deploy.yaml | 65 ++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml index ecaeb70..322ae83 100644 --- a/.forgejo/workflows/deploy.yaml +++ b/.forgejo/workflows/deploy.yaml @@ -1,29 +1,29 @@ -name: Deploy Blog -on: - push: - branches: [main] - -jobs: - deploy: - runs-on: ubuntu-latest - container: - image: node:18 - volumes: - - /var/www/systemsobscure.blog:/output - steps: - - uses: actions/checkout@v3 - - run: npm install - - run: npm run build:posts - - run: npm run build - - name: Deploy files - run: | - mkdir -p /output - rm -rf /output/* - cp -r dist/* /output/ +# name: Deploy Blog +# on: +# push: +# branches: [main] # jobs: # deploy: # runs-on: ubuntu-latest +# container: +# image: node:18 +# volumes: +# - /var/www/systemsobscure.blog:/output +# steps: +# - uses: actions/checkout@v3 +# - run: npm install +# - run: npm run build:posts +# - run: npm run build +# - name: Deploy files +# run: | +# mkdir -p /output +# rm -rf /output/* +# cp -r dist/* /output/ + +# # jobs: +# deploy: +# runs-on: ubuntu-latest # container: node:18 # steps: # - uses: actions/checkout@v3 @@ -40,3 +40,24 @@ jobs: # scp -i /tmp/ssh_key -o StrictHostKeyChecking=no -r dist/* thomas@localhost:/var/www/systemsobscure.blog/ # rm /tmp/ssh_key +name: Deploy Blog +on: + push: + branches: [main] +jobs: + deploy: + runs-on: ubuntu-latest + container: node:18 + steps: + - uses: actions/checkout@v3 + - run: npm install + - run: npm run build:posts + - run: npm run build + - name: Deploy via SSH + run: | + echo "${{ secrets.SSH_PRIVATE_KEY }}" > /tmp/ssh_key + chmod 600 /tmp/ssh_key + HOST_IP=$(ip route show default | awk '/default/ {print $3}') + ssh -i /tmp/ssh_key -o StrictHostKeyChecking=no thomas@$HOST_IP "rm -rf /var/www/systemsobscure.blog/*" + scp -i /tmp/ssh_key -o StrictHostKeyChecking=no -r dist/* thomas@$HOST_IP:/var/www/systemsobscure.blog/ + rm /tmp/ssh_key