From eadb31a4c4de3a76cbae1e5131c11a113cc56d17 Mon Sep 17 00:00:00 2001 From: Amir Pourmand Date: Sat, 7 Oct 2023 12:18:56 +0330 Subject: [PATCH] Add DockerSlim (#1699) --- .github/workflows/docker-slim.yml | 51 +++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/docker-slim.yml diff --git a/.github/workflows/docker-slim.yml b/.github/workflows/docker-slim.yml new file mode 100644 index 000000000000..54a3c19026d7 --- /dev/null +++ b/.github/workflows/docker-slim.yml @@ -0,0 +1,51 @@ +name: Docker Slim + +#Only trigger, when the build workflow succeeded +on: + workflow_run: + workflows: ["Docker Image CI"] + types: + - completed + +# on: +# push: +# branches: +# - 'master' + +jobs: + build: + runs-on: ubuntu-latest + if: github.repository_owner == 'alshedivat' + + defaults: + run: + working-directory: ${{ github.workspace }} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Login + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: update docker-compose + shell: bash + run: | + sed -i "s|\.:|${{ github.workspace }}:|g" ${{ github.workspace }}/docker-compose.yml + cat ${{ github.workspace }}/docker-compose.yml + + - uses: kitabisa/docker-slim-action@v1.0.3 + env: + DSLIM_PULL: true + DSLIM_COMPOSE_FILE: ${{ github.workspace }}/docker-compose.yml + DSLIM_TARGET_COMPOSE_SVC: jekyll + DSLIM_CONTINUE_AFTER: signal + with: + target: amirpourmand/al-folio + tag: "slim" + + # Push to the registry + - run: docker image push amirpourmand/al-folio:slim