From cbd056845faeaac2839117f97bc90f74dab63de6 Mon Sep 17 00:00:00 2001 From: Denis Lugowski Date: Tue, 18 Nov 2025 08:24:30 +0100 Subject: [PATCH] feat(pipeline): Add deploy job --- .gitea/workflows/deploy.yaml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .gitea/workflows/deploy.yaml diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..31d69d0 --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,36 @@ +name: Deploy to Production +run-name: ${{ gitea.actor }} triggered deployment on ${{ gitea.ref_name }} + +on: + workflow_run: + workflows: ["Frontend CI/CD", "Backend CI/CD"] + types: + - completed + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + if: ${{ gitea.event.workflow_run.conclusion == 'success' }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup SSH + run: | + mkdir -p ~/.ssh + chmod 700 ~/.ssh + echo "${{ secrets.SYNOLOGY_DEPLOY_KEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + + - name: Deploy to server + run: | + ssh -o StrictHostKeyChecking=accept-new deploy@ds218 'sudo /usr/local/bin/deployLegalconsenthub.sh' + + - name: Deployment successful + run: | + echo "✅ Deployment triggered successfully" + echo "🚀 Application is being deployed to production" +