diff --git a/.github/workflows/build-docker-monorepo.yml b/.github/workflows/build-docker-monorepo.yml index 325a439199e1..becf603926d1 100644 --- a/.github/workflows/build-docker-monorepo.yml +++ b/.github/workflows/build-docker-monorepo.yml @@ -61,6 +61,14 @@ jobs: elif [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then gh_set_output tags "type=ref,event=pr" gh_set_output images "ghcr.io/automattic/jetpack-monorepo" + elif [[ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then + if [[ "$GITHUB_REF" == "refs/heads/trunk" ]]; then + gh_set_output tags "type=raw,latest" + gh_set_output images $'automattic/jetpack-wordpress-dev\nghcr.io/automattic/jetpack-wordpress-dev' + else + echo "Workflow dispatch for non-trunk ref $GITHUB_REF is not supported" + exit 1 + fi else echo "Unknown GITHUB_EVENT_NAME $GITHUB_EVENT_NAME" exit 1 diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 0eea8672abbf..7e8304082408 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -63,6 +63,14 @@ jobs: elif [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then gh_set_output tags "type=ref,event=pr" gh_set_output images "ghcr.io/automattic/jetpack-wordpress-dev" + elif [[ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then + if [[ "$GITHUB_REF" == "refs/heads/trunk" ]]; then + gh_set_output tags "type=raw,latest" + gh_set_output images $'automattic/jetpack-wordpress-dev\nghcr.io/automattic/jetpack-wordpress-dev' + else + echo "Workflow dispatch for non-trunk ref $GITHUB_REF is not supported" + exit 1 + fi else echo "Unknown GITHUB_EVENT_NAME $GITHUB_EVENT_NAME" exit 1