Precompile Semgrep AST patterns before scanning (#343) #117
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy www | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "www/**" | |
| - "src/rules/**" | |
| - "src/bin/gen_rules_ts.rs" | |
| - ".github/workflows/deploy-www.yml" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| deployments: write | |
| concurrency: | |
| group: deploy-www-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| deploy: | |
| name: Build and deploy foxguard.dev | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22.12.0" | |
| cache: npm | |
| cache-dependency-path: www/package-lock.json | |
| - name: Install dependencies | |
| working-directory: www | |
| run: npm ci | |
| - name: Build site | |
| working-directory: www | |
| run: npm run build | |
| - name: Sanity-check Cloudflare credentials | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| run: | | |
| echo "token length: ${#CLOUDFLARE_API_TOKEN}" | |
| echo "account id length: ${#CLOUDFLARE_ACCOUNT_ID}" | |
| verify=$(curl -sS "https://api.cloudflare.com/client/v4/user/tokens/verify" -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN") | |
| echo "verify: $(echo "$verify" | jq -r '.success')" | |
| project=$(curl -sS "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/pages/projects/foxguard" -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN") | |
| echo "project success: $(echo "$project" | jq -r '.success')" | |
| echo "project name: $(echo "$project" | jq -r '.result.name // "null"')" | |
| echo "project errors: $(echo "$project" | jq -c '.errors')" | |
| - name: Deploy to Cloudflare Pages | |
| working-directory: www | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| run: npx --yes wrangler@4.81.1 pages deploy dist --project-name=foxguard --branch=main |