name: ๐Ÿš€ Deploy API on: push: branches: [main] paths: - 'api/**' - 'awesome-privacy.yml' - '.github/workflows/deploy.yml' workflow_dispatch: permissions: contents: read concurrency: group: deploy-api-${{ github.ref }} cancel-in-progress: false jobs: checks: name: ๐Ÿงช Checks if: github.repository == 'lissy93/awesome-privacy' runs-on: ubuntu-latest defaults: run: working-directory: api steps: - uses: actions/checkout@v6 with: persist-credentials: false - uses: oven-sh/setup-bun@v2 with: bun-version: 1.3.10 - run: bun install --frozen-lockfile - run: bun run build:data - run: bun run lint - run: bun run test deploy: name: โ˜๏ธ Deploy to Cloudflare needs: checks if: github.repository == 'lissy93/awesome-privacy' runs-on: ubuntu-latest defaults: run: working-directory: api steps: - uses: actions/checkout@v6 with: persist-credentials: false - uses: oven-sh/setup-bun@v2 with: bun-version: 1.3.10 - run: bun install --frozen-lockfile - name: Build data and deploy worker env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} run: bun run deploy