Skip to content

Commit

Permalink
Add input to specify the build url to use
Browse files Browse the repository at this point in the history
  • Loading branch information
benja-M-1 committed Nov 9, 2023
1 parent 9cf4699 commit e7baacb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@ jobs:
strategy:
matrix:
os: [ ubuntu22_16cores_64gb ] #, macos-latest ]
build-url: [ "latest", "https://desktop.docker.com/linux/main/amd64/122432/docker-desktop-4.24.0-amd64.deb" ]
timeout-minutes: 20
steps:
- uses: actions/checkout@v4

- name: Start Desktop
uses: ./start
timeout-minutes: 5
with:
docker-desktop-build-url: ${{ matrix.build-url }}

- name: Docker Desktop version
run: docker version >> $GITHUB_STEP_SUMMARY

- name: Docker Desktop info
run: docker info
Expand Down
28 changes: 27 additions & 1 deletion start/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: "Docker Desktop action"
description: "Start Docker Desktop on a Github Action node"
inputs:
docker-desktop-build-url:
description: "Docker Desktop build url to use for installation"
required: false
default: "latest"
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -81,6 +86,27 @@ runs:
/usr/bin/open /Applications/Docker.app --args --unattended --add-host-docker-internal-registry
echo "Docker starting..."
- name: Download appcast
if: runner.os == 'Linux'
shell: bash
run: |
curl https://desktop.docker.com/linux/main/amd64/appcast.xml -o appcast.xml
- name: Get Docker Desktop latest build url
if: runner.os == 'Linux' && inputs.docker-desktop-build-url == "latest"
uses: mavrosxristoforos/[email protected]
id: get-latest-build-url
with:
xml-file: appcast.xml
xpath: //channel/link

- name: Define the build URL to use
if: runner.os == 'Linux'
shell: bash
id: get-build-url
run:
echo "info=${{ inputs.docker-desktop-build-url || steps.get-latest-build-url.outputs.info }}" >> $GITHUB_OUTPUT

- name: Cache Docker Desktop packages
if: runner.os == 'Linux'
id: cache-docker-desktop
Expand All @@ -95,7 +121,7 @@ runs:
shell: bash
run: |
mkdir -p ~/.downloads
curl -sSL https://desktop.docker.com/linux/main/amd64/docker-desktop-4.25.0-amd64.deb > ~/.downloads/docker-desktop.deb
curl -sSL ${{ steps.get-build-url.outputs.info }} > ~/.downloads/docker-desktop.deb
- name: Check for CPU with VM support
if: runner.os == 'Linux'
Expand Down

0 comments on commit e7baacb

Please sign in to comment.