Build AdGuard filters #6939
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: Build AdGuard filters | |
| on: | |
| # For manual run builds | |
| workflow_dispatch: | |
| schedule: | |
| # Run every hour at minute 0 | |
| - cron: '0 * * * *' | |
| pull_request: | |
| paths-ignore: | |
| # Do not trigger build on changes to the following files. | |
| # It is needed to avoid pull request merge blocking | |
| # as compiler does not use the updated config during the build. | |
| - "optimization_config.json" | |
| env: | |
| BUILD_MODE: adguard | |
| jobs: | |
| build: | |
| if: "!contains(github.event.head_commit.message, 'skip ci')" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo with depth 1 | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.x | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: yarn | |
| - name: Lint | |
| run: yarn lint | |
| - name: Build filters | |
| run: yarn auto-build --mode ${{ env.BUILD_MODE }} | |
| - name: Commit & Push changes | |
| uses: actions-js/[email protected] | |
| if: github.ref == 'refs/heads/master' && github.repository == 'AdguardTeam/FiltersRegistry' && github.event_name != 'pull_request' | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: "master" | |
| message: "skip ci: auto-build ${{ env.BUILD_MODE }} filters" | |
| notify: | |
| name: Send Slack notification on failure | |
| runs-on: ubuntu-latest | |
| needs: build | |
| # Run even if the build job failed, but only for our own repo | |
| if: | |
| ${{ | |
| always() && | |
| needs.build.result == 'failure' && | |
| github.repository == 'AdguardTeam/FiltersRegistry' && | |
| ( | |
| github.event_name == 'push' || | |
| github.event_name == 'schedule' || | |
| github.event_name == 'workflow_dispatch' || | |
| ( | |
| github.event_name == 'pull_request' && | |
| github.event.pull_request.head.repo.full_name == github.repository | |
| ) | |
| ) | |
| }} | |
| steps: | |
| - uses: 8398a7/action-slack@v3 | |
| with: | |
| status: failure | |
| fields: workflow,repo,message,commit,author,eventName,ref,job | |
| job_name: Build AdGuard filters | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |