Skip to content

Commit

Permalink
Re enable caching but correctly install when cache is hit
Browse files Browse the repository at this point in the history
  • Loading branch information
benja-M-1 committed Nov 7, 2023
1 parent 4600ded commit feb98ac
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions start/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ runs:
echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
shell: bash

# - name: Get Docker app cache
# id: cache-docker-desktop-app
# uses: actions/cache@v3
# env:
# cache-name: cache-docker-desktop-app
# with:
# path: /Applications/Docker.app
# key: docker-desktop-app-mac-amd64-${{ steps.get-date.outputs.date }}
- name: Get Docker app cache
id: cache-docker-desktop-app
uses: actions/cache@v3
env:
cache-name: cache-docker-desktop-app
with:
path: /Applications/Docker.app
key: docker-desktop-app-mac-amd64-${{ steps.get-date.outputs.date }}

- name: Get Docker install settings cache
id: cache-docker-desktop-install-settings
Expand Down Expand Up @@ -44,7 +44,7 @@ runs:
echo "/Library/Application Support/com.docker.docker/"
ls "/Library/Application Support/com.docker.docker/"
- name: Install Docker Desktop dmg
- name: Install Docker Desktop from dmg
if: steps.cache-docker-desktop-install-settings.outputs.cache-hit != 'true'
shell: bash
run: |
Expand All @@ -58,16 +58,27 @@ runs:
sudo ./mount/desktop/Docker.app/Contents/MacOS/install --accept-license --user runner
echo "dmg installed"
/usr/bin/hdiutil detach ./mount/desktop
echo "dmg unmounted"
- name: Install Docker Desktop from cache
if: steps.cache-docker-desktop-install-settings.outputs.cache-hit == 'true'
shell: bash
run: |
sudo mkdir /Library/PrivilegedHelperTools
sudo /Applications/Docker.app/Contents/MacOS/install --accept-license --user runner
# todo (ben): check if that is really useful
- name: Copy Docker Desktop settings for caching
shell: bash
run: |
echo "ls /Library/Application Support/com.docker.docker"
ls "/Library/Application Support/com.docker.docker" || true
mkdir -p ./cache/desktopInstallSettings
cp "/Library/Application Support/com.docker.docker/"* ./cache/desktopInstallSettings/
echo "ls ./cache/desktopInstallSettings/"
ls ./cache/desktopInstallSettings/ || true
/usr/bin/hdiutil detach ./mount/desktop
echo "dmg unmounted"
- name: Start Docker Desktop app
shell: bash
run: |
Expand Down

0 comments on commit feb98ac

Please sign in to comment.