name: Deploy on: push: branches: [main] workflow_dispatch: permissions: contents: read concurrency: group: deploy cancel-in-progress: false jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Node uses: actions/setup-node@v4 with: node-version: 22 cache: npm - name: Install dependencies run: npm ci - name: Verify site run: npm run verify - name: Build site run: npm run build deploy: needs: build if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - name: Trigger Dokploy webhook env: DOKPLOY_WEBHOOK_URL: ${{ secrets.DOKPLOY_WEBHOOK_URL }} run: | if [ -z "$DOKPLOY_WEBHOOK_URL" ]; then echo "DOKPLOY_WEBHOOK_URL secret is not set." exit 1 fi curl --fail-with-body --show-error --silent \ --request POST \ --header "Content-Type: application/json" \ --header "X-GitHub-Event: push" \ --data "{\"ref\":\"${GITHUB_REF}\",\"after\":\"${GITHUB_SHA}\",\"repository\":{\"full_name\":\"${GITHUB_REPOSITORY}\"}}" \ "$DOKPLOY_WEBHOOK_URL"