Skip to content

Commit

Permalink
Add stats to github actions comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeLonewolf committed Jun 19, 2023
1 parent 09cf915 commit 1d1c634
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ jobs:
AWS_REGION: ${{ secrets.AWS_REGION }}
SOURCE_DIR: "./dist"
DEST_DIR: pr/${{ github.event.pull_request.number }}
- name: Capture usage statistics
id: stats
run: |
LAYER_COUNT=$(node scripts/stats.js -c)
STYLE_SIZE=$(node scripts/stats.js -s)
LAYER_STATS=$(node scripts/stats.js -a)
echo "LAYER_COUNT<<EOF" >> $GITHUB_ENV
echo -e "$LAYER_COUNT" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "STYLE_SIZE<<EOF" >> $GITHUB_ENV
echo -e "$STYLE_SIZE" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "LAYER_STATS<<EOF" >> $GITHUB_ENV
echo -e "$LAYER_STATS" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Comment Pull Request
uses: thollander/[email protected]
with:
Expand All @@ -55,4 +70,12 @@ jobs:
![Sprites 1x](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/sprite.png)
![Sprites 2x](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/[email protected])
Style Size:
* ${{ env.LAYER_COUNT }}
* ${{ env.STYLE_SIZE }}
```
${{ env.LAYER_STATS }}
```
comment_tag: pr_preview

0 comments on commit 1d1c634

Please sign in to comment.