From ec68a935bfd4a415ea8fdb419a274b621287ab7e Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 11 Nov 2020 12:41:24 +0100 Subject: [PATCH 1/2] Create main.yml --- .github/workflows/main.yml | 53 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..553146f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,53 @@ +name: CI + +on: + push: + branches: + - develop + - master + pull_request: + branches: + - master + release: + types: [published] + schedule: + - cron: '0 0 * * 0' + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Runs a set of commands using the runners shell + - name: Install prerequesites + run: | + sudo apt-get update + sudo apt-get install tree -y + sudo apt-get -qq autoremove --purge + sudo apt-get install jpegoptim -y + sudo -E time bash scripts/install-webp.sh > /dev/null 2>&1 + sudo -E time bash scripts/install-optipng.sh > /dev/null 2>&1 + sudo wget -qO /usr/local/bin/avif https://github.com/Kagami/go-avif/releases/download/v0.1.0/avif-linux-x64 + sudo chmod +x /usr/local/bin/avif + sudo cp optimize.sh /usr/local/bin/img-optimize + sudo chmod 755 /usr/local/bin/img-optimize + + - name: Optimize Images + run: | + ls -alh images/ + /usr/local/bin/img-optimize --all -q + ls -alh images/ + /usr/local/bin/img-optimize --jpg -q + /usr/local/bin/img-optimize --png -q + rm images/*.webp + /usr/local/bin/img-optimize --webp + tree -L 2 . + rm images/*.webp + /usr/local/bin/img-optimize --webp --quiet From e7d9dee89016e754f6f0ad2c7488e5fb42c13376 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 11 Nov 2020 12:47:08 +0100 Subject: [PATCH 2/2] Update main.yml --- .github/workflows/main.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 553146f..89ca79e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,8 +29,6 @@ jobs: - name: Install prerequesites run: | sudo apt-get update - sudo apt-get install tree -y - sudo apt-get -qq autoremove --purge sudo apt-get install jpegoptim -y sudo -E time bash scripts/install-webp.sh > /dev/null 2>&1 sudo -E time bash scripts/install-optipng.sh > /dev/null 2>&1 @@ -42,12 +40,10 @@ jobs: - name: Optimize Images run: | ls -alh images/ - /usr/local/bin/img-optimize --all -q + /usr/local/bin/img-optimize --avif ls -alh images/ - /usr/local/bin/img-optimize --jpg -q - /usr/local/bin/img-optimize --png -q - rm images/*.webp /usr/local/bin/img-optimize --webp - tree -L 2 . - rm images/*.webp - /usr/local/bin/img-optimize --webp --quiet + ls -alh images/ + rm -f images/*.webp images/*.avif + /usr/local/bin/img-optimize --all + ls -alh images/