From 0b417aaba95a0d3aafb56b027568826ea413a473 Mon Sep 17 00:00:00 2001 From: Essential Randomness Date: Tue, 21 Apr 2026 21:46:28 -0700 Subject: [PATCH] github action --- .github/workflows/deploy.yml | 92 ++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 47 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5235a64..fc1a5a5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,55 +1,53 @@ -name: Deploy to GitHub Pages +name: Deploy on: - push: - branches: [ main ] - schedule: - - cron: "0 * * * *" - workflow_dispatch: + push: + branches: [main] + workflow_dispatch: permissions: - contents: read - pages: write - id-token: write + contents: read concurrency: - group: pages - cancel-in-progress: false + 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: Build site - run: npm run build - - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: dist - - deploy: - needs: build - runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Configure Pages - uses: actions/configure-pages@v5 - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + 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: 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" -- 2.51.2