diff --git a/.github/workflows/publish_to_dockerhub.yml b/.github/workflows/publish_to_dockerhub.yml index 2496ad7e95..8f7a4ee9ba 100644 --- a/.github/workflows/publish_to_dockerhub.yml +++ b/.github/workflows/publish_to_dockerhub.yml @@ -4,8 +4,8 @@ name: Push images to DockerHub on: push: # Publish `master` as Docker `latest` and `git_revision` images. - branches: - - master + #branches: + # - master release: # Publish released commit as Docker `latest` and `git_revision` images. types: @@ -128,7 +128,7 @@ jobs: run: make test publish_wsc: # Ensure test job passes before pushing image. - needs: tests_wsc + #needs: tests_wsc name: Publish WindowsServerCore-based image to DockerHub runs-on: windows-2022 steps: @@ -138,6 +138,26 @@ jobs: # Allows to fetch all history for all branches and tags. Need this for proper versioning. fetch-depth: 0 + - name: Cache GoWSC-22 Docker image + uses: actions/cache@v2 + id: cache-gowsc + env: + cache-name: cache-gowsc-image + with: + path: ./docker-cache + key: ${{ runner.os }}-build-${{ env.cache-name }} + + - name: Download GoWSC-22 Docker image + if: steps.cache-gowsc.outputs.cache-hit != 'true' + run: | + mkdir ./docker-cache + docker pull golang:windowsservercore-ltsc2022 + docker save -o ./docker-cache/gowsc.tar golang:windowsservercore-ltsc2022 + + - name: Restore GoWSC-22 Docker image from cache + if: steps.cache-gowsc.outputs.cache-hit == 'true' + run: docker load -i ./docker-cache/gowsc.tar + - name: Build image run: make image-wsc