From 760d4c1a20cdbc527517aa1838f40cf94e8b9e37 Mon Sep 17 00:00:00 2001 From: Guillem George Date: Wed, 27 May 2026 15:14:54 +0200 Subject: [PATCH] CD pipeline --- .forgejo/workflows/deploy.yaml | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .forgejo/workflows/deploy.yaml diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml new file mode 100644 index 0000000..fdfefed --- /dev/null +++ b/.forgejo/workflows/deploy.yaml @@ -0,0 +1,39 @@ +name: Prepare and deploy +on: + push: + branches: + - main + +jobs: + build: + runs-on: docker + container: + image: alpine:3 + + steps: + - name: Checkout git repository + uses: actions/checkout@v4 + + - name: Prepare files + run: | + tar cvzf all-in-one.tar.gz .zshrc .p10k.zsh .local/ + + - name: Install Deployment Tools + run: | + if command -v apk >/dev/null; then + apk add --no-cache rsync openssh-client + else + apt-get update && apt-get install -y rsync openssh-client + fi + + - name: Setup SSH + uses: https://github.com/webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: Deploy + run: | + rsync -avz -e "ssh -p ${{ secrets.SERVER_PORT }} -o StrictHostKeyChecking=no" --delete \ + ./all-in-one.tar.gz \ + ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }}:${{ secrets.DESTINATION }} +