Skip to content

Commit

Permalink
Moving all base container workflows to another docker caching system
Browse files Browse the repository at this point in the history
For faster builds
  • Loading branch information
danakim committed Sep 20, 2023
1 parent 18bb17a commit c176a29
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 14 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/build-php72-apache2-node14-composer2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
20 changes: 18 additions & 2 deletions .github/workflows/build-php72-apache2-node16-composer2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
20 changes: 18 additions & 2 deletions .github/workflows/build-php72-apache2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
20 changes: 18 additions & 2 deletions .github/workflows/build-php82-apache2-node14-composer2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
20 changes: 18 additions & 2 deletions .github/workflows/build-php82-apache2-node16-composer2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
20 changes: 18 additions & 2 deletions .github/workflows/build-php82-apache2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
20 changes: 18 additions & 2 deletions .github/workflows/build-php82-fpm-apache2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

0 comments on commit c176a29

Please sign in to comment.