Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/.idea
#/node_modules
93 changes: 93 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,99 @@ default: `latest`
version: 1.22.4
```

### installScriptUrl

URL to the DDEV installation script. This allows you to specify a custom or alternative source for the DDEV installation script.

default: `https://ddev.com/install.sh`

```
- uses: ddev/github-action-setup-ddev@v1
with:
installScriptUrl: "https://raw.githubusercontent.com/ddev/ddev/v1.22.4/scripts/install_ddev.sh"
```

This option is useful for:
- Using a specific version of the installation script from a tagged release
- Testing with a development version from a specific branch
- Using a forked or modified version of the installation script
- Working with air-gapped environments that require local script hosting

Example with custom script source:

```
- name: Setup DDEV with custom installation script
uses: ddev/github-action-setup-ddev@v1
with:
installScriptUrl: "https://my-company.com/scripts/custom_ddev_install.sh"
version: "v1.22.4"
retryAttempts: 3
```

### Retry configuration options

The action includes built-in retry logic with exponential backoff for improved reliability in CI/CD environments. These options are all optional and have sensible defaults.

#### retryAttempts

Maximum number of retry attempts for DDEV installation and operations.

default: `5`

```
- uses: ddev/github-action-setup-ddev@v1
with:
retryAttempts: 5
```

#### initialDelay

Initial delay in seconds between retries.

default: `2`

```
- uses: ddev/github-action-setup-ddev@v1
with:
initialDelay: 5
```

#### maxDelay

Maximum delay in seconds between retries. This prevents the delay from growing too large with exponential backoff.

default: `30`

```
- uses: ddev/github-action-setup-ddev@v1
with:
maxDelay: 60
```

#### retryMultiplier

Delay multiplier for exponential backoff. Each retry will multiply the previous delay by this value.

default: `2`

```
- uses: ddev/github-action-setup-ddev@v1
with:
retryMultiplier: 3
```

#### jitterPercent

Jitter percentage (0-100) to add randomness to retry delays. This helps prevent thundering herd problems when multiple jobs retry simultaneously.

default: `25`

```
- uses: ddev/github-action-setup-ddev@v1
with:
jitterPercent: 50
```

## Common recipes

### SSH keys
Expand Down
103 changes: 90 additions & 13 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,100 @@
name: 'Setup DDEV in Github Workflows'
description: |
This action installs **DDEV** in your Github Workflow.
name: 'Setup and start DDEV action'
description: 'Set up your GitHub Actions workflow with DDEV'
author: 'Jonas Eberle and DDEV contributors'
runs:
using: 'node20'
main: 'lib/main.js'
branding:
icon: cpu
color: yellow

inputs:
ddevDir:
description: 'ddev project directory'
description: 'Path to your DDEV project. This path needs to contain the .ddev/ directory.'
required: false
default: '.'

autostart:
description: 'Start ddev automatically'
description: 'Starts your DDEV project immediately.'
required: false
default: true
default: 'true'

version:
description: 'Install a specific ddev version, such as 1.22.4'
description: 'Install a specific DDEV version. Example: 1.24.0'
required: false
default: 'latest'

retryAttempts:
description: 'Maximum number of retry attempts for DDEV installation and operations'
required: false
default: '5'

initialDelay:
description: 'Initial delay in seconds between retries'
required: false
default: '2'

maxDelay:
description: 'Maximum delay in seconds between retries'
required: false
default: '30'

retryMultiplier:
description: 'Delay multiplier for exponential backoff'
required: false
default: '2'

jitterPercent:
description: 'Jitter percentage (0-100) to add randomness to retry delays'
required: false
default: '25'

installScriptUrl:
description: 'URL to the DDEV installation script'
required: true
default: 'https://ddev.com/install.sh'

runs:
using: 'composite'
steps:
- name: Download DDEV install script
shell: bash
run: |
"${{ github.action_path }}/scripts/retry.sh" \
--attempts "${{ inputs.retryAttempts }}" \
--initial-delay "${{ inputs.initialDelay }}" \
--max-delay "${{ inputs.maxDelay }}" \
--multiplier "${{ inputs.retryMultiplier }}" \
--jitter "${{ inputs.jitterPercent }}" \
--description "Download DDEV install script" \
-- curl -fsSL --retry 3 --retry-max-time 60 --retry-connrefused \
-o /tmp/install_ddev.sh \
"${{ inputs.installScriptUrl }}"

- name: Install DDEV
shell: bash
run: |
if [[ '${{ inputs.version }}' != 'latest' ]]; then
VERSION_ARG="v${{ inputs.version }}"
echo "Installing DDEV version: ${VERSION_ARG}"
else
VERSION_ARG=""
echo "Installing latest DDEV version"
fi

# Make installation script executable
chmod +x /tmp/install_ddev.sh

"${{ github.action_path }}/scripts/retry.sh" \
--attempts "${{ inputs.retryAttempts }}" \
--initial-delay "${{ inputs.initialDelay }}" \
--max-delay "${{ inputs.maxDelay }}" \
--multiplier "${{ inputs.retryMultiplier }}" \
--jitter "${{ inputs.jitterPercent }}" \
--description "DDEV installation" \
-- /tmp/install_ddev.sh ${VERSION_ARG}

- name: Start DDEV project
shell: bash
working-directory: ${{ inputs.ddevDir }}
if: inputs.autostart == 'true'
run: |
ddev start

branding:
icon: 'cpu'
color: yellow
111 changes: 0 additions & 111 deletions lib/main.js

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/uuid

This file was deleted.

56 changes: 0 additions & 56 deletions node_modules/.package-lock.json

This file was deleted.

Loading