diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index 44f21435..6e65c489 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -3,7 +3,7 @@ name: Docker Image CI on: [push] jobs: - build_with_cache: + build_test_project: runs-on: ubuntu-latest services: registry: @@ -16,10 +16,24 @@ jobs: uses: docker/setup-buildx-action@v1 with: driver-opts: network=host - - name: Cache Docker layers + - name: Set colonists-shared cache uses: actions/cache@v2 with: - path: /tmp/.buildx-cache + path: /tmp/.buildx-cache-shared + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Set colonists-server cache + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache-server + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Set colonists-client cache + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache-client key: ${{ runner.os }}-buildx-${{ github.sha }} restore-keys: | ${{ runner.os }}-buildx- @@ -28,16 +42,18 @@ jobs: with: push: true tags: localhost:5000/colonists/colonists-shared - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache-shared + cache-to: type=local,dest=/tmp/.buildx-cache-shared context: ./colonists-shared + - name: Run shared tests + run: docker run --rm localhost:5000/colonists/colonists-shared - name: Build server uses: docker/build-push-action@v2 with: push: false tags: colonists/colonists-server - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache-server + cache-to: type=local,dest=/tmp/.buildx-cache-server context: ./colonists-server build-args: | "LOCAL_REGISTRY=localhost:5000/" @@ -46,11 +62,9 @@ jobs: with: push: false tags: colonists/colonists-client - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache-client + cache-to: type=local,dest=/tmp/.buildx-cache-client context: ./colonists-client build-args: | "LOCAL_REGISTRY=localhost:5000/" - - name: Run shared tests - run: docker run --rm localhost:5000/colonists/colonists-shared