-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- deletes unused images no longer needed by i18n files - converts non webp images -runs weekly and commits to develop
- Loading branch information
1 parent
ba963e9
commit 109111c
Showing
4 changed files
with
77 additions
and
217 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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Check images | ||
|
||
on: | ||
workflow_dispatch: | ||
pull-request: | ||
branch: | ||
- tabatha/images2-workflow | ||
# schedule: | ||
# - cron: '0 17 * * 1' # 9AM PST (5PM UTC) on Monday mornings | ||
|
||
env: | ||
BOT_NAME: nr-opensource-bot | ||
BOT_EMAIL: opensource+bot@newrelic.com | ||
|
||
jobs: | ||
check-images: | ||
name: Convert to WebP/Remove unused | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: tabatha/images-workflow2 | ||
persist-credentials: false | ||
|
||
- name: Setup node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Install dependencies | ||
run: yarn add glob10@npm:glob@^10.0.0 meow@11.0.0 webp-converter@2.3.3 | ||
|
||
- name: Remove unused images | ||
run: yarn remove-unused-images | ||
|
||
- name: Convert images to WEBP | ||
run: yarn convert-to-webp -g | ||
# - name: Commit changes | ||
# id: commit-changes | ||
# run: | | ||
# git config --local user.email "${{ env.BOT_EMAIL }}" | ||
# git config --local user.name "${{ env.BOT_NAME }}" | ||
# git add ./src/data/whats-new-ids.json | ||
# git diff-index --quiet HEAD ./src/data/whats-new-ids.json || git commit -m 'chore(images): convert to webp & remove unused images' | ||
# echo "commit=true" >> $GITHUB_OUTPUT | ||
# - name: Push Commit | ||
# if: steps.commit-changes.outputs.commit == 'true' | ||
# uses: ad-m/github-push-action@v0.6.0 | ||
# with: | ||
# github_token: ${{ secrets.DEVEX_OPENSOURCE_BOT_TOKEN }} | ||
# branch: develop |
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
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
Oops, something went wrong.