Skip to content

Commit

Permalink
Add pagespeed action
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoporto committed Dec 6, 2024
1 parent ac5ddfd commit 00105e4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
44 changes: 23 additions & 21 deletions .github/workflows/lighthouse-badges.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,30 @@ on: workflow_dispatch

jobs:
lighthouse-badger-easy:
runs-on: ubuntu-22.04
timeout-minutes: 8
runs-on: ubuntu-latest
env:
URLS: 'https://tiagoporto.github.io/svg-music-logos'
TOKEN_NAME: # target token name; insert only the name never the real value e.g. 'LIGHTHOUSE_BADGER_TOKEN'
REPO_BRANCH: '${{ github.repository }} badge'
URL: 'https://tiagoporto.github.io/svg-music-logos'
steps:
- name: Preparatory Tasks
run: |
REPOSITORY=`expr "${{ env.REPO_BRANCH }}" : "\([^ ]*\)"`
BRANCH=`expr "${{ env.REPO_BRANCH }}" : ".* \([^ ]*\)"`
echo "REPOSITORY=$REPOSITORY" >> $GITHUB_ENV
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
repository: ${{ env.REPO_BRANCH }}
token: ${{ secrets[env.TOKEN_NAME] }}
ref: ${{ env.REPO_BRANCH }}
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
repository: 'myactionway/lighthouse-badges'
path: temp_lighthouse_badges_nested
- uses: myactionway/lighthouse-badger-action@v2.2
ref: ${{ github.head_ref }}

- name: Setup node
uses: actions/setup-node@v4
with:
urls: ${{ env.URLS }}
node-version-file: '.nvmrc'

- name: Install Dependencies
run: npm ci --ignore-scripts

- name: Generate badges
run: npm run lighthouse-badge

- name: Commit changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add docs/pagespeed.svg
git commit -m "Add pagespeed badge"
git push
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Listen on:

## Status ✅

![Pagespeed insights](./docs/pagespeed.svg)

[![Website](https://img.shields.io/website/https/tiagoporto.github.io/svg-music-logos.svg?down_color=lightgrey\&down_message=offline\&style=flat-square\&up_message=online)](https://tiagoporto.github.io/svg-music-logos)
[![W3C Validation](https://img.shields.io/w3c-validation/html.svg?style=flat-square\&targetUrl=https://tiagoporto.github.io/svg-music-logos)](https://validator.nu/?doc=https%3A%2F%2Ftiagoporto.github.io%2Fsvg-music-logos)
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/tiagoporto/svg-music-logos/ci.yml?label=checks\&style=flat-square)](https://github.com/tiagoporto/svg-music-logos/actions/workflows/ci.yml)
Expand Down

0 comments on commit 00105e4

Please sign in to comment.