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" +