Skip to content

Commit

Permalink
github: enable base docker images caching for WSC
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnaShaleva committed Feb 9, 2022
1 parent 5a521ae commit 5a30c88
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/publish_to_dockerhub.yml
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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

Expand Down

0 comments on commit 5a30c88

Please sign in to comment.