Skip to content

Commit ae1fb26

Browse files
committed
feat: Enhance GitHub workflows with manual triggers and improved image building logic
- Added `workflow_dispatch` support to `docker-publish.yml` and `execution-env-publish.yml` for manual execution. - Introduced input option `build_all` in `execution-env-publish.yml` to force build all images. - Updated logic in `execution-env-publish.yml` to determine target languages based on workflow events and changes to the workflow file.
1 parent 83322eb commit ae1fb26

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches: ["main", "dev"]
66
tags: ["v*.*.*"]
7+
workflow_dispatch:
78

89
env:
910
REGISTRY: ghcr.io

.github/workflows/execution-env-publish.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,24 @@ on:
55
branches: ["main", "dev"]
66
paths:
77
- "docker/**"
8+
- ".github/workflows/execution-env-publish.yml"
9+
workflow_dispatch:
10+
inputs:
11+
build_all:
12+
description: 'Force build all images'
13+
type: boolean
14+
default: false
815

916
env:
1017
REGISTRY: ghcr.io
1118
IMAGE_BASE: ${{ github.repository }}
19+
ALL_LANGUAGES: '["python", "nodejs", "go", "java", "c-cpp", "php", "rust", "fortran", "r", "d"]'
1220

1321
jobs:
1422
filter:
1523
runs-on: ubuntu-latest
1624
outputs:
17-
changes: ${{ steps.changes.outputs.changes }}
25+
changes: ${{ steps.determine-targets.outputs.languages }}
1826
steps:
1927
- uses: actions/checkout@v4
2028
- uses: dorny/paths-filter@v3
@@ -44,6 +52,18 @@ jobs:
4452
d:
4553
- 'docker/d.Dockerfile'
4654
55+
- name: Determine targets
56+
id: determine-targets
57+
run: |
58+
if [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ "${{ github.event.inputs.build_all }}" == "true" ]; then
59+
echo "languages=${{ env.ALL_LANGUAGES }}" >> $GITHUB_OUTPUT
60+
elif [ "${{ github.event_name }}" == "push" ] && echo "${{ github.event.head_commit.modified }}" | grep -q ".github/workflows/execution-env-publish.yml"; then
61+
# If workflow itself changed, build everything
62+
echo "languages=${{ env.ALL_LANGUAGES }}" >> $GITHUB_OUTPUT
63+
else
64+
echo "languages=${{ steps.changes.outputs.changes }}" >> $GITHUB_OUTPUT
65+
fi
66+
4767
build-images:
4868
needs: filter
4969
if: ${{ needs.filter.outputs.changes != '[]' && needs.filter.outputs.changes != '' }}

0 commit comments

Comments
 (0)