diff --git a/.github/workflows/optimize-images.yml b/.github/workflows/optimize-images.yml new file mode 100644 index 0000000000..1cb6143b6e --- /dev/null +++ b/.github/workflows/optimize-images.yml @@ -0,0 +1,72 @@ +name: Optimize images + +# **What it does**: Optimize images. +# **Why we have it**: Reduce bandwidth needs. +# **Who does it impact**: Docs engineering. + +on: + workflow_dispatch: + pull_request: + paths: + - '**/*.png' + +permissions: + contents: write + pull-requests: write + +jobs: + optimize-images-on-pr: + # We can't make commits on forks + if: github.repository == 'github/docs-internal' + runs-on: ubuntu-latest + steps: + - name: Check out repo on head ref + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + with: + ref: ${{ github.head_ref }} + # Need to specify a PAT here because otherwise GITHUB_TOKEN is used + # by default. Workflows won't trigger in that case because actions + # performed with GITHUB_TOKEN don't trigger other workflows. + token: ${{ secrets.DOCUBOT_REPO_PAT }} + + - name: Check out base ref + run: git fetch --no-tags --depth=1 origin $GITHUB_BASE_REF + + - name: Install the Optipng package + run: sudo apt-get update && sudo apt-get -y install optipng + + - name: Run optipng on new or changed images + run: | + set -e # exit when any command fails + + echo "Ensure we can view $GITHUB_BASE_REF" + git checkout $GITHUB_BASE_REF + + echo "Ensure we can view $GITHUB_HEAD_REF" + git checkout $GITHUB_HEAD_REF + + echo "List the files that changed" + git diff --name-only --diff-filter=d $GITHUB_BASE_REF $GITHUB_HEAD_REF + + echo "Run optipng on pngs in from the diff" + git diff --name-only -z --diff-filter=d $GITHUB_BASE_REF $GITHUB_HEAD_REF -- '*.png' | xargs -0 optipng -nx + + - name: Make a commit and a push + run: | + echo "If there's no changes, exit" + if [[ ! `git status --porcelain` ]] + then + echo "No changes found" + exit 0 + fi + + echo "Make a commit" + git config user.name github-actions + git config user.email github-actions@github.com + git add "*.png" + git commit --message="Optimize images" + + echo "Push up changes" + git push + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/assets/images/enterprise/repository/blame-button.png b/assets/images/enterprise/repository/blame-button.png index c85abf3c96..84a45cbb76 100644 Binary files a/assets/images/enterprise/repository/blame-button.png and b/assets/images/enterprise/repository/blame-button.png differ diff --git a/assets/images/enterprise/repository/edit-file-edit-button.png b/assets/images/enterprise/repository/edit-file-edit-button.png index af6fe2bac0..6cc0c7b0ea 100644 Binary files a/assets/images/enterprise/repository/edit-file-edit-button.png and b/assets/images/enterprise/repository/edit-file-edit-button.png differ diff --git a/assets/images/enterprise/repository/edit-readme-preview-changes.png b/assets/images/enterprise/repository/edit-readme-preview-changes.png index 2ffbb4f120..fd0cd78ba7 100644 Binary files a/assets/images/enterprise/repository/edit-readme-preview-changes.png and b/assets/images/enterprise/repository/edit-readme-preview-changes.png differ diff --git a/assets/images/enterprise/repository/git-blame.png b/assets/images/enterprise/repository/git-blame.png index 6b0b20a0b3..8381756ab1 100644 Binary files a/assets/images/enterprise/repository/git-blame.png and b/assets/images/enterprise/repository/git-blame.png differ diff --git a/assets/images/enterprise/repository/new-file-preview.png b/assets/images/enterprise/repository/new-file-preview.png index 6e6008acc0..75be4b4fa9 100644 Binary files a/assets/images/enterprise/repository/new-file-preview.png and b/assets/images/enterprise/repository/new-file-preview.png differ diff --git a/assets/images/enterprise/repository/raw-file-button.png b/assets/images/enterprise/repository/raw-file-button.png index 3a84eaf6c9..b3711c7197 100644 Binary files a/assets/images/enterprise/repository/raw-file-button.png and b/assets/images/enterprise/repository/raw-file-button.png differ diff --git a/assets/images/enterprise/site-admin-settings/dependabot-alerts-setup-dropdown.png b/assets/images/enterprise/site-admin-settings/dependabot-alerts-setup-dropdown.png index 6713c80d55..019c7a16a6 100644 Binary files a/assets/images/enterprise/site-admin-settings/dependabot-alerts-setup-dropdown.png and b/assets/images/enterprise/site-admin-settings/dependabot-alerts-setup-dropdown.png differ diff --git a/assets/images/github-apps/authorize_app.png b/assets/images/github-apps/authorize_app.png index d25cf67a1d..df6794516b 100644 Binary files a/assets/images/github-apps/authorize_app.png and b/assets/images/github-apps/authorize_app.png differ diff --git a/assets/images/github-apps/install_app.png b/assets/images/github-apps/install_app.png index 2170708b45..d60adaa213 100644 Binary files a/assets/images/github-apps/install_app.png and b/assets/images/github-apps/install_app.png differ diff --git a/assets/images/help/actions/arc-diagram.png b/assets/images/help/actions/arc-diagram.png index 56668357be..fbbcbdea43 100644 Binary files a/assets/images/help/actions/arc-diagram.png and b/assets/images/help/actions/arc-diagram.png differ diff --git a/assets/images/help/billing/update_payment_method_org.png b/assets/images/help/billing/update_payment_method_org.png index c1ea49d7db..9d64630c1f 100644 Binary files a/assets/images/help/billing/update_payment_method_org.png and b/assets/images/help/billing/update_payment_method_org.png differ diff --git a/assets/images/help/billing/update_payment_method_personal_account.png b/assets/images/help/billing/update_payment_method_personal_account.png index 4b10174d29..872c6312db 100644 Binary files a/assets/images/help/billing/update_payment_method_personal_account.png and b/assets/images/help/billing/update_payment_method_personal_account.png differ diff --git a/assets/images/help/billing/view-payment-history-link-personal-account.png b/assets/images/help/billing/view-payment-history-link-personal-account.png index 95446c0a01..72538a65ba 100644 Binary files a/assets/images/help/billing/view-payment-history-link-personal-account.png and b/assets/images/help/billing/view-payment-history-link-personal-account.png differ diff --git a/assets/images/help/branches/branch-selection-dropdown.png b/assets/images/help/branches/branch-selection-dropdown.png index 99bd9ae7ae..33fb446fb6 100644 Binary files a/assets/images/help/branches/branch-selection-dropdown.png and b/assets/images/help/branches/branch-selection-dropdown.png differ diff --git a/assets/images/help/branches/file-tree-view-branch-dropdown.png b/assets/images/help/branches/file-tree-view-branch-dropdown.png index 195f47e278..8ec099ae1f 100644 Binary files a/assets/images/help/branches/file-tree-view-branch-dropdown.png and b/assets/images/help/branches/file-tree-view-branch-dropdown.png differ diff --git a/assets/images/help/codespaces/settings-sync-config-ok.png b/assets/images/help/codespaces/settings-sync-config-ok.png index 8e0e0f3e15..fa3a8098e7 100644 Binary files a/assets/images/help/codespaces/settings-sync-config-ok.png and b/assets/images/help/codespaces/settings-sync-config-ok.png differ diff --git a/assets/images/help/codespaces/who-will-pay-vscode.png b/assets/images/help/codespaces/who-will-pay-vscode.png index 3a86713eb7..afd3e7bdb0 100644 Binary files a/assets/images/help/codespaces/who-will-pay-vscode.png and b/assets/images/help/codespaces/who-will-pay-vscode.png differ diff --git a/assets/images/help/codespaces/who-will-pay.png b/assets/images/help/codespaces/who-will-pay.png index 1623308231..e8cae40624 100644 Binary files a/assets/images/help/codespaces/who-will-pay.png and b/assets/images/help/codespaces/who-will-pay.png differ diff --git a/assets/images/help/copilot/copilot-cancel-trial.png b/assets/images/help/copilot/copilot-cancel-trial.png index c4890901a8..b27cd72b5b 100644 Binary files a/assets/images/help/copilot/copilot-cancel-trial.png and b/assets/images/help/copilot/copilot-cancel-trial.png differ diff --git a/assets/images/help/desktop/ahead-tab.png b/assets/images/help/desktop/ahead-tab.png index 4c1c7b079d..23d35b76af 100644 Binary files a/assets/images/help/desktop/ahead-tab.png and b/assets/images/help/desktop/ahead-tab.png differ diff --git a/assets/images/help/desktop/view-pr-on-github.png b/assets/images/help/desktop/view-pr-on-github.png index 25210219a7..3d921bcdc1 100644 Binary files a/assets/images/help/desktop/view-pr-on-github.png and b/assets/images/help/desktop/view-pr-on-github.png differ diff --git a/assets/images/help/gist/starring-a-gist.png b/assets/images/help/gist/starring-a-gist.png index 506a35fb48..766d6d6ced 100644 Binary files a/assets/images/help/gist/starring-a-gist.png and b/assets/images/help/gist/starring-a-gist.png differ diff --git a/assets/images/help/graphs/activity-view-compare-changes.png b/assets/images/help/graphs/activity-view-compare-changes.png index e9b0798bd8..f9546151da 100644 Binary files a/assets/images/help/graphs/activity-view-compare-changes.png and b/assets/images/help/graphs/activity-view-compare-changes.png differ diff --git a/assets/images/help/graphs/activity-view-embedded-link.png b/assets/images/help/graphs/activity-view-embedded-link.png index 37a72e4888..f4d510c47a 100644 Binary files a/assets/images/help/graphs/activity-view-embedded-link.png and b/assets/images/help/graphs/activity-view-embedded-link.png differ diff --git a/assets/images/help/graphs/activity-view-icon.png b/assets/images/help/graphs/activity-view-icon.png index 061ff2bf45..715b43b109 100644 Binary files a/assets/images/help/graphs/activity-view-icon.png and b/assets/images/help/graphs/activity-view-icon.png differ diff --git a/assets/images/help/projects-v2/filter-for-templates.png b/assets/images/help/projects-v2/filter-for-templates.png index 1efef61ef7..c6dc0475af 100644 Binary files a/assets/images/help/projects-v2/filter-for-templates.png and b/assets/images/help/projects-v2/filter-for-templates.png differ diff --git a/assets/images/help/repository/add-files-buttons.png b/assets/images/help/repository/add-files-buttons.png index 59859ce17d..0845ddf997 100644 Binary files a/assets/images/help/repository/add-files-buttons.png and b/assets/images/help/repository/add-files-buttons.png differ diff --git a/assets/images/help/repository/choose-commit-email-address.png b/assets/images/help/repository/choose-commit-email-address.png index d6d4b45634..fe23d8b225 100644 Binary files a/assets/images/help/repository/choose-commit-email-address.png and b/assets/images/help/repository/choose-commit-email-address.png differ diff --git a/assets/images/help/repository/delete-file-button.png b/assets/images/help/repository/delete-file-button.png index fd6a43b46b..d7c4c56e0c 100644 Binary files a/assets/images/help/repository/delete-file-button.png and b/assets/images/help/repository/delete-file-button.png differ diff --git a/assets/images/help/repository/file-tree-view-branch-dropdown-expanded.png b/assets/images/help/repository/file-tree-view-branch-dropdown-expanded.png index 2f334c4eb7..61f3dba11f 100644 Binary files a/assets/images/help/repository/file-tree-view-branch-dropdown-expanded.png and b/assets/images/help/repository/file-tree-view-branch-dropdown-expanded.png differ diff --git a/assets/images/help/repository/fork_button.png b/assets/images/help/repository/fork_button.png index c8fb42e0f4..f4190488b6 100644 Binary files a/assets/images/help/repository/fork_button.png and b/assets/images/help/repository/fork_button.png differ diff --git a/assets/images/help/repository/https-url-clone-cli.png b/assets/images/help/repository/https-url-clone-cli.png index 8c245d429b..2a57eb0637 100644 Binary files a/assets/images/help/repository/https-url-clone-cli.png and b/assets/images/help/repository/https-url-clone-cli.png differ diff --git a/assets/images/help/repository/new-branch.png b/assets/images/help/repository/new-branch.png index 6f6932c6cb..38c1462e07 100644 Binary files a/assets/images/help/repository/new-branch.png and b/assets/images/help/repository/new-branch.png differ diff --git a/assets/images/help/repository/upload-files-button.png b/assets/images/help/repository/upload-files-button.png index a4371a54ad..53680709b4 100644 Binary files a/assets/images/help/repository/upload-files-button.png and b/assets/images/help/repository/upload-files-button.png differ diff --git a/assets/images/help/settings/scheduled-reminders-org-choice.png b/assets/images/help/settings/scheduled-reminders-org-choice.png index bd7d9e4d07..fd92e11191 100644 Binary files a/assets/images/help/settings/scheduled-reminders-org-choice.png and b/assets/images/help/settings/scheduled-reminders-org-choice.png differ diff --git a/assets/images/help/writing/inline-backtick-math-markdown-rendering.png b/assets/images/help/writing/inline-backtick-math-markdown-rendering.png index c911d17ab1..f5d062228e 100644 Binary files a/assets/images/help/writing/inline-backtick-math-markdown-rendering.png and b/assets/images/help/writing/inline-backtick-math-markdown-rendering.png differ diff --git a/assets/images/help/writing/inline-math-markdown-rendering.png b/assets/images/help/writing/inline-math-markdown-rendering.png index 2f8636c8f0..2ca1c7a476 100644 Binary files a/assets/images/help/writing/inline-math-markdown-rendering.png and b/assets/images/help/writing/inline-math-markdown-rendering.png differ diff --git a/assets/images/help/writing/math-expression-as-a-block-rendering.png b/assets/images/help/writing/math-expression-as-a-block-rendering.png index e99e9b1d92..d7594b0228 100644 Binary files a/assets/images/help/writing/math-expression-as-a-block-rendering.png and b/assets/images/help/writing/math-expression-as-a-block-rendering.png differ diff --git a/assets/images/site/apple-touch-icon-114x114.png b/assets/images/site/apple-touch-icon-114x114.png index 8520369396..1792a42831 100644 Binary files a/assets/images/site/apple-touch-icon-114x114.png and b/assets/images/site/apple-touch-icon-114x114.png differ diff --git a/assets/images/site/apple-touch-icon-120x120.png b/assets/images/site/apple-touch-icon-120x120.png index fbaa2a6ff4..95903a6f89 100644 Binary files a/assets/images/site/apple-touch-icon-120x120.png and b/assets/images/site/apple-touch-icon-120x120.png differ diff --git a/assets/images/site/apple-touch-icon-144x144.png b/assets/images/site/apple-touch-icon-144x144.png index b9eb51f7ea..a7df9a401a 100644 Binary files a/assets/images/site/apple-touch-icon-144x144.png and b/assets/images/site/apple-touch-icon-144x144.png differ diff --git a/assets/images/site/apple-touch-icon-152x152.png b/assets/images/site/apple-touch-icon-152x152.png index 751d286a52..191e190e73 100644 Binary files a/assets/images/site/apple-touch-icon-152x152.png and b/assets/images/site/apple-touch-icon-152x152.png differ diff --git a/assets/images/site/apple-touch-icon-180x180.png b/assets/images/site/apple-touch-icon-180x180.png index 12b4fb0b23..29ab743018 100644 Binary files a/assets/images/site/apple-touch-icon-180x180.png and b/assets/images/site/apple-touch-icon-180x180.png differ diff --git a/assets/images/site/apple-touch-icon-192x192.png b/assets/images/site/apple-touch-icon-192x192.png index 9ecc7c51e3..e23ec12299 100644 Binary files a/assets/images/site/apple-touch-icon-192x192.png and b/assets/images/site/apple-touch-icon-192x192.png differ diff --git a/assets/images/site/apple-touch-icon-512x512.png b/assets/images/site/apple-touch-icon-512x512.png index 8d76a12f5e..280a5e3dc5 100644 Binary files a/assets/images/site/apple-touch-icon-512x512.png and b/assets/images/site/apple-touch-icon-512x512.png differ diff --git a/assets/images/site/apple-touch-icon-57x57.png b/assets/images/site/apple-touch-icon-57x57.png index b6f3340bd7..23f6fc2430 100644 Binary files a/assets/images/site/apple-touch-icon-57x57.png and b/assets/images/site/apple-touch-icon-57x57.png differ diff --git a/assets/images/site/apple-touch-icon-60x60.png b/assets/images/site/apple-touch-icon-60x60.png index 695434160d..81be8bc982 100644 Binary files a/assets/images/site/apple-touch-icon-60x60.png and b/assets/images/site/apple-touch-icon-60x60.png differ diff --git a/assets/images/site/apple-touch-icon-72x72.png b/assets/images/site/apple-touch-icon-72x72.png index 678617e170..b69474e6a7 100644 Binary files a/assets/images/site/apple-touch-icon-72x72.png and b/assets/images/site/apple-touch-icon-72x72.png differ diff --git a/assets/images/site/apple-touch-icon-76x76.png b/assets/images/site/apple-touch-icon-76x76.png index a71c93f36c..be3506dc41 100644 Binary files a/assets/images/site/apple-touch-icon-76x76.png and b/assets/images/site/apple-touch-icon-76x76.png differ