diff --git a/.gitea/workflows/build-and-deploy.yml b/.gitea/workflows/build-and-deploy.yml new file mode 100644 index 0000000..8d8b436 --- /dev/null +++ b/.gitea/workflows/build-and-deploy.yml @@ -0,0 +1,48 @@ +name: Build & Deploy to EasyPanel + +on: + push: + branches: + - source-code + workflow_dispatch: + +jobs: + build-and-notify: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci --no-audit --no-fund + + - name: Build Astro site + run: npm run build + + - name: Trigger EasyPanel deploy + if: success() + env: + EASYPANEL_WEBHOOK_URL: ${{ secrets.EASYPANEL_WEBHOOK_URL }} + run: | + if [ -z "$EASYPANEL_WEBHOOK_URL" ]; then + echo "::warning::EASYPANEL_WEBHOOK_URL secret is empty — skipping deploy trigger. Set it in repo settings to enable auto-deploy." + exit 0 + fi + echo "Triggering EasyPanel deploy at $EASYPANEL_WEBHOOK_URL" + curl -fsS -X POST "$EASYPANEL_WEBHOOK_URL" \ + -H "Content-Type: application/json" \ + -d "{\"ref\":\"${{ github.ref }}\",\"sha\":\"${{ github.sha }}\",\"event\":\"push\"}" \ + || echo "::error::EasyPanel webhook returned non-2xx (continuing — site already built in artifact if you want to download)" + + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/ + retention-days: 7 diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml new file mode 100644 index 0000000..566fd00 --- /dev/null +++ b/.gitea/workflows/lint.yml @@ -0,0 +1,22 @@ +name: Lint & Test + +on: + push: + branches: + - source-code + pull_request: + branches: + - source-code + +jobs: + build-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + - run: npm ci --no-audit --no-fund + - name: Build (catches syntax + missing-image errors before deploy) + run: npm run build