From c176a29491c20d3391fdebeadbbd247aa0f50416 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 20 Sep 2023 15:17:01 +0300 Subject: [PATCH] Moving all base container workflows to another docker caching system For faster builds --- .../build-php72-apache2-node14-composer2.yaml | 20 +++++++++++++++++-- .../build-php72-apache2-node16-composer2.yaml | 20 +++++++++++++++++-- .github/workflows/build-php72-apache2.yaml | 20 +++++++++++++++++-- .../build-php82-apache2-node14-composer2.yaml | 20 +++++++++++++++++-- .../build-php82-apache2-node16-composer2.yaml | 20 +++++++++++++++++-- .github/workflows/build-php82-apache2.yaml | 20 +++++++++++++++++-- .../workflows/build-php82-fpm-apache2.yaml | 20 +++++++++++++++++-- 7 files changed, 126 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-php72-apache2-node14-composer2.yaml b/.github/workflows/build-php72-apache2-node14-composer2.yaml index 240a282..6ca6d64 100644 --- a/.github/workflows/build-php72-apache2-node14-composer2.yaml +++ b/.github/workflows/build-php72-apache2-node14-composer2.yaml @@ -24,6 +24,14 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Login to GitHub Container Registry uses: docker/login-action@v2 with: @@ -40,5 +48,13 @@ jobs: tags: | ghcr.io/openconext/openconext-basecontainers/php72-apache2-node14-composer2:latest ghcr.io/openconext/openconext-basecontainers/php72-apache2-node14-composer2:${{ github.sha }} - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache diff --git a/.github/workflows/build-php72-apache2-node16-composer2.yaml b/.github/workflows/build-php72-apache2-node16-composer2.yaml index be068e4..a5c339d 100644 --- a/.github/workflows/build-php72-apache2-node16-composer2.yaml +++ b/.github/workflows/build-php72-apache2-node16-composer2.yaml @@ -25,6 +25,14 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Login to GitHub Container Registry uses: docker/login-action@v2 with: @@ -41,5 +49,13 @@ jobs: tags: | ghcr.io/openconext/openconext-basecontainers/php72-apache2-node16-composer2:latest ghcr.io/openconext/openconext-basecontainers/php72-apache2-node16-composer2:${{ github.sha }} - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache diff --git a/.github/workflows/build-php72-apache2.yaml b/.github/workflows/build-php72-apache2.yaml index f4dece9..26eedbf 100644 --- a/.github/workflows/build-php72-apache2.yaml +++ b/.github/workflows/build-php72-apache2.yaml @@ -24,6 +24,14 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Login to GitHub Container Registry uses: docker/login-action@v2 with: @@ -40,5 +48,13 @@ jobs: tags: | ghcr.io/openconext/openconext-basecontainers/php72-apache2:latest ghcr.io/openconext/openconext-basecontainers/php72-apache2:${{ github.sha }} - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache diff --git a/.github/workflows/build-php82-apache2-node14-composer2.yaml b/.github/workflows/build-php82-apache2-node14-composer2.yaml index 1f9d102..7b4e916 100644 --- a/.github/workflows/build-php82-apache2-node14-composer2.yaml +++ b/.github/workflows/build-php82-apache2-node14-composer2.yaml @@ -24,6 +24,14 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Login to GitHub Container Registry uses: docker/login-action@v2 with: @@ -40,5 +48,13 @@ jobs: tags: | ghcr.io/openconext/openconext-basecontainers/php82-apache2-node14-composer2:latest ghcr.io/openconext/openconext-basecontainers/php82-apache2-node14-composer2:${{ github.sha }} - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache diff --git a/.github/workflows/build-php82-apache2-node16-composer2.yaml b/.github/workflows/build-php82-apache2-node16-composer2.yaml index 48dc5d7..faed3e6 100644 --- a/.github/workflows/build-php82-apache2-node16-composer2.yaml +++ b/.github/workflows/build-php82-apache2-node16-composer2.yaml @@ -25,6 +25,14 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Login to GitHub Container Registry uses: docker/login-action@v2 with: @@ -41,5 +49,13 @@ jobs: tags: | ghcr.io/openconext/openconext-basecontainers/php82-apache2-node16-composer2:latest ghcr.io/openconext/openconext-basecontainers/php82-apache2-node16-composer2:${{ github.sha }} - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache diff --git a/.github/workflows/build-php82-apache2.yaml b/.github/workflows/build-php82-apache2.yaml index a21c964..3ad09f3 100644 --- a/.github/workflows/build-php82-apache2.yaml +++ b/.github/workflows/build-php82-apache2.yaml @@ -24,6 +24,14 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Login to GitHub Container Registry uses: docker/login-action@v2 with: @@ -40,5 +48,13 @@ jobs: tags: | ghcr.io/openconext/openconext-basecontainers/php82-apache2:latest ghcr.io/openconext/openconext-basecontainers/php82-apache2:${{ github.sha }} - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache diff --git a/.github/workflows/build-php82-fpm-apache2.yaml b/.github/workflows/build-php82-fpm-apache2.yaml index 88af7ff..02af55d 100644 --- a/.github/workflows/build-php82-fpm-apache2.yaml +++ b/.github/workflows/build-php82-fpm-apache2.yaml @@ -24,6 +24,14 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Login to GitHub Container Registry uses: docker/login-action@v2 with: @@ -40,5 +48,13 @@ jobs: tags: | ghcr.io/openconext/openconext-basecontainers/php82-fpm-apache2:latest ghcr.io/openconext/openconext-basecontainers/php82-fpm-apache2:${{ github.sha }} - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache