From c490c8ab0f5608a67684e2721d896343044d9a6d Mon Sep 17 00:00:00 2001 From: Lars Nolden Date: Tue, 23 Jun 2026 21:56:14 +0200 Subject: [PATCH] add deploy action --- .gitea/workflows/deploy.yml | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..ec2e900 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,44 @@ +name: Deploy Static Site + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build static site + run: npm run build + + - name: Setup SSH key + run: | + mkdir -p ~/.ssh + echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + + - name: Deploy static files to server + run: | + rsync -avz --delete \ + -e "ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=accept-new" \ + out/ \ + deploy@${{ secrets.DEPLOY_HOST }}:/home/deploy/projects/ge-bos/static/ + + - name: Run deployment script + run: | + ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=accept-new \ + deploy@${{ secrets.DEPLOY_HOST }} \ + "cd /home/deploy/projects/ge-bos && ./deploy.sh"