diff --git a/README.md b/README.md index 6f72dd1..81fb4a1 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,76 @@ Examples: URL(s) to the current repository & master branch with minimal settings. + +
Set it up (click to toggle) + +1. add the [lighthouse-badger-easy.yml](https://github.com/MyActionWay/lighthouse-badger-workflows/blob/master/.github/workflows/lighthouse-badger-easy.yml "Get it") workflow file to a repository + * the path has to be `.github/workflows/lighthouse-badger-easy.yml` + * it have to be the target repository where you want to add the Lighthouse results (not the case with the other workflow files) +2. create a new encrypted repository secret [[procedure](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository "Learn how")] + * add the secret to the same repository where you added this workflow file + * give the secret a name e. g. `LIGHTHOUSE_BADGER_TOKEN` + * the value of the secret must be the value of the personal access token for the repository where you want to add the Lighthouse results. + * [procedure for creating a personal access token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token "Learn how") + * select only the minimum scopes and permissions required e. g. repo +3. adapt your [lighthouse-badger-easy.yml](https://github.com/MyActionWay/lighthouse-badger-workflows/blob/master/.github/workflows/lighthouse-badger-easy.yml "Get it") file + * for manual triggers + * you don't have to adjust anything in the workflow file; just use it + * [procedure for manually running a workflow on GitHub](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow#running-a-workflow-on-github "Learn how") + + * [procedure for manually running a workflow using the GitHub CLI](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow#running-a-workflow-using-github-cli) + * [procedure for manually running a workflow using the REST API](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow#running-a-workflow-using-the-rest-api) + * for all other triggers + * adapt this section + ```yml + ############################################################## + # DEFINE YOUR INPUTS AND TRIGGERS IN THE FOLLOWING + ############################################################## + + # INPUTS as environmental variables (env) + env: + URLS: # URL(s) to be checked e.g. 'https://github.com/sitdisch https://github.com/mythemeway' + TOKEN_NAME: # target token name e.g. 'LIGHTHOUSE_BADGER_TOKEN' + + # TRIGGERS + on: + # page_build: + # schedule: + # - cron: '55 23 * * 0' + ``` + * CONSIDER: + * INPUTS: + * you only have to define `URLS` and `TOKEN_NAME`; + * `TOKEN_NAME`: never enter the actual value of the personal access token + * TRIGGERS: + * `page_build`: Lighthouse results are generated every time after the GitHub page is built + * `schedule`: + * e. g. `cron: '55 23 * * 0'` executes the [Lighthouse-Badger](https://github.com/myactionway/lighthouse-badger-action "Get it") every Sunday at 23:55 + * you can check your inputs [here](https://crontab.guru/ "Go there") + * hidden defaults (changeable with the other workflow files): + * target repository & branch: Repository with this workflow file and master branch + * outputs: + * badges: pagespeed.svg + * reports: yes + * output-paths: + * lighthouse_results/mobile + * lighthouse_results/desktop + * audit types: + * mobile: + * parameters: '--throttling.cpuSlowdownMultiplier=2' + * desktop: + * parameters: '--throttling.cpuSlowdownMultiplier=1' + * other settings: + * user who commit: github-actions[bot] + * user e-mail address: 41898282+github-actions[bot]@users.noreply.github.com + * commit message: Lighthouse-Badger[bot]: Results Added + +That's it. Happy audits. + +

+ ### [lighthouse-badger-default.yml](https://github.com/MyActionWay/lighthouse-badger-workflows/blob/master/.github/workflows/lighthouse-badger-default.yml "Get it") Generates, adds & updates manually/automatically Lighthouse badges & reports from one/multiple input URL(s) to a selected target repository & branch. @@ -96,7 +166,7 @@ Generates, adds & updates manually/automatically Lighthouse badges & reports fro ``` * CONSIDER: * INPUTS: - * you only have to define `TOKEN_NAME` and `URLS`; if any other input is blank, one of these default values will be used instead + * you only have to define `URLS` and `TOKEN_NAME`; if any other input is blank, one of these default values will be used instead ```yml DEFAULT_REPO_BRANCH: '${{ github.repository }} master' # repo with this file and master branch DEFAULT_BADGES_ARGS: '-b pagespeed -o lighthouse_results -r' @@ -129,7 +199,7 @@ That's it. Happy audits.

### [lighthouse-badger-advanced.yml](https://github.com/MyActionWay/lighthouse-badger-workflows/blob/master/.github/workflows/lighthouse-badger-advanced.yml "Get it") -Generates, adds & updates manually/automatically Lighthouse badges & reports from one/multiple input URL-group(s) to one/multiple target repo(s)/branch(es) in parallel +Generates, adds & updates manually/automatically Lighthouse badges & reports from one/multiple input URL-group(s) to one/multiple target repo(s)/branch(es) in parallel.

Set it up (click to toggle) @@ -252,6 +322,10 @@ That's it. Happy audits. * The [Branch-Pruner](https://github.com/myactionway/branch-pruner-action "Get it") can help. E. g. put your Lighthouse results on a separate branch and automatically prune that branch with the Pruner, as you like. * The workflow logs do not provide enough detail to diagnose why a workflow, job, or step is not working as expected. * enable [addition debug logging](https://docs.github.com/en/actions/managing-workflow-runs/enabling-debug-logging) +* You get a failed job because not all remote commits were fetched during parallel computing. + * increase `max_push_attempts` in your workflow file (default = 5) +* You are experiencing strange behavior from GitHub actions. + * maybe it's a general incident [[status check](https://www.githubstatus.com/ "Check it")] ## | Application example