diff --git a/.github/workflows/optimize.yml b/.github/workflows/optimize.yml new file mode 100644 index 000000000..7112c4edd --- /dev/null +++ b/.github/workflows/optimize.yml @@ -0,0 +1,34 @@ +name: optimize + +on: + push: + branches: [ master ] + workflow_dispatch: + +permissions: + contents: write + +env: + WESNOTH_VERSION: 1.17.14 + +jobs: + optimize: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.DEPLOY_SECRET_KEY }} + - name: Optimize images + uses: czyzby/wesnoth-png-optimizer@v1 + continue-on-error: true + with: + wesnoth-version: ${{ env.WESNOTH_VERSION }} + threshold: 0 + - name: Commit images + run: | + git config --global user.name "GitHub Action" + git config --global user.email "actions@users.noreply.github.com" + git commit -am "🤖 Optimize $GITHUB_REPOSITORY@$GITHUB_SHA" + git push