Assets #166
This file contains 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: Assets | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 20 * * *' | |
jobs: | |
assets: | |
name: Update local assets | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
if: github.repository_owner == 'ghostery' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Use node | |
uses: actions/setup-node@v4 | |
with: | |
cache: yarn | |
node-version-file: '.tool-versions' | |
registry-url: https://registry.npmjs.org | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Build | |
run: yarn build | |
- name: Fetch latest assets | |
id: fetch | |
working-directory: ./packages/adblocker/assets | |
run: | | |
node update.js | |
- name: Generate compression codebooks | |
id: codebooks | |
working-directory: ./packages/adblocker/ | |
run: | | |
yarn generate-codebooks | |
- uses: tibdex/github-app-token@v1 | |
id: generate-token | |
with: | |
app_id: ${{ secrets.ADBLOCKERBOT_APP_ID }} | |
private_key: ${{ secrets.ADBLOCKERBOT_PRIVATE_KEY }} | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
committer: Ghostery Adblocker Bot <[email protected]> | |
author: Ghostery Adblocker Bot <[email protected]> | |
commit-message: "Update local assets and compression codebooks" | |
title: "Update local assets" | |
body: "Automated update of local assets and compression codebooks." | |
reviewers: remusao | |
branch: update-assets | |
labels: "PR: Internal :house:" | |
- name: Check outputs | |
run: | | |
echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}" | |
echo "Pull Request Number - ${{ steps.cpr.outputs.pr_number }}" |