Skip to content

Commit 81a2b79

Browse files
committed
Change workflow to use cache instead of docker pull.
1 parent d4084db commit 81a2b79

1 file changed

Lines changed: 21 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ jobs:
2424
build-docker-nextcloud:
2525
runs-on: ubuntu-latest
2626
steps:
27+
- uses: actions/cache@v3
28+
id: cache-solid-nextcloud-docker
29+
with:
30+
path: cache/solid-nextcloud
31+
key: solid-nextcloud-docker-${{ github.sha }}
32+
2733
- uses: actions/checkout@v3
2834

2935
- uses: docker/login-action@v2
@@ -34,8 +40,13 @@ jobs:
3440

3541
- name: Build Solid-Nextcloud Docker image
3642
run: |
37-
docker build -t "ghcr.io/pdsinterop/solid-nextcloud:${{ github.sha }}" .
43+
docker build \
44+
--tag "solid-nextcloud:${{ github.sha }}" \
45+
--tag "ghcr.io/pdsinterop/solid-nextcloud:${{ github.sha }}" \
46+
.
3847
docker push "ghcr.io/pdsinterop/solid-nextcloud:${{ github.sha }}"
48+
mkdir -p cache/solid-nextcloud
49+
docker image save solid-nextcloud:${{ github.sha }} --output ./cache/solid-nextcloud/${{ github.sha }}.tar
3950
4051
solid-testsuite:
4152
strategy:
@@ -54,6 +65,12 @@ jobs:
5465
steps:
5566
- uses: actions/checkout@v3
5667

68+
- uses: actions/cache@v3
69+
id: cache-solid-nextcloud-docker
70+
with:
71+
path: cache/solid-nextcloud
72+
key: solid-nextcloud-docker-${{ github.sha }}
73+
5774
- uses: docker/login-action@v2
5875
with:
5976
registry: ghcr.io
@@ -62,9 +79,9 @@ jobs:
6279

6380
- name: Pull docker Images
6481
run: |
82+
docker image load --input ./cache/solid-nextcloud/${{ github.sha }}.tar
6583
docker pull michielbdejong/nextcloud-cookie:${{ env.COOKIE_TAG }}
6684
docker pull ${{ matrix.test }}
67-
docker pull ghcr.io/pdsinterop/solid-nextcloud:${{ github.sha }}
6885
docker pull ghcr.io/pdsinterop/php-solid-pubsub-server:${{ env.PUBSUB_TAG }}
6986
7087
- name: Start Docker Containers
@@ -78,8 +95,8 @@ jobs:
7895
"ghcr.io/pdsinterop/php-solid-pubsub-server:${{ env.PUBSUB_TAG }}"
7996
8097
source ./run-solid-test-suite.sh
81-
startSolidNextcloud 'server' "ghcr.io/pdsinterop/solid-nextcloud:${{ github.sha }}" ${{ matrix.test }}
82-
startSolidNextcloud 'thirdparty' "ghcr.io/pdsinterop/solid-nextcloud:${{ github.sha }}" ${{ matrix.test }}
98+
startSolidNextcloud 'server' "solid-nextcloud:${{ github.sha }}" ${{ matrix.test }}
99+
startSolidNextcloud 'thirdparty' "solid-nextcloud:${{ github.sha }}" ${{ matrix.test }}
83100
84101
echo "COOKIE_server=${COOKIE_server}" >> "${GITHUB_ENV}"
85102
echo "COOKIE_thirdparty=${COOKIE_thirdparty}" >> "${GITHUB_ENV}"

0 commit comments

Comments
 (0)