This repository has been archived by the owner on Jun 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: extracted analyze step to its own workflow
/spent 15m
- Loading branch information
Showing
3 changed files
with
57 additions
and
36 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,28 +104,14 @@ jobs: | |
analyze: | ||
needs: deploy | ||
runs-on: ubuntu-latest | ||
env: | ||
SITE_URL: ${{ vars.SITE_URL }} | ||
PSI_STRAT: ${{ vars.PSI_STRAT }} | ||
PSI_DIR: ${{ vars.PSI_DIR }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Run PSI-SVG | ||
run: | | ||
mkdir -p $PSI_DIR | ||
npx psi-svg $SITE_URL $PSI_DIR/psi.svg --strategy=$PSI_STRAT | ||
- name: Commit and push analysis svg | ||
- name: Trigger Analysis Workflow | ||
env: | ||
PERSONAL_ACCESS_TOKEN: ${{ secrets.WEBHOOK_PAT }} | ||
run: | | ||
git config --global user.name 'GitHub Action' | ||
git config --global user.email '[email protected]' | ||
git add $PSI_DIR/psi.svg | ||
git commit -m "chore(deployment): update page speed insights svg [skip ci]" | ||
git push | ||
curl \ | ||
-X POST \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
-H "Authorization: token ${PERSONAL_ACCESS_TOKEN}" \ | ||
https://api.github.com/repos/${{ github.repository }}/dispatches \ | ||
-d '{"event_type": "analyze-site-event"}' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Analyze Site Performance and Generate SVG | ||
|
||
on: | ||
repository_dispatch: | ||
types: [analyze-site-event] | ||
|
||
jobs: | ||
analyze: | ||
runs-on: ubuntu-latest | ||
env: | ||
SITE_URL: ${{ vars.SITE_URL }} | ||
PSI_STRAT: ${{ vars.PSI_STRAT }} | ||
PSI_DIR: ${{ vars.PSI_DIR }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Run PSI-SVG | ||
run: | | ||
mkdir -p $PSI_DIR | ||
npx psi-svg $SITE_URL $PSI_DIR/psi.svg --strategy=$PSI_STRAT | ||
- name: Commit and push analysis svg | ||
run: | | ||
git config --global user.name 'GitHub Action' | ||
git config --global user.email '[email protected]' | ||
git add $PSI_DIR/psi.svg | ||
git commit -m "chore(deployment): update page speed insights svg [skip ci]" | ||
git push |
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