Skip to content

Commit cbc73d4

Browse files
authored
Fix docker GH action (#4159)
* Move env to action * Move secret access to workflows * Fix dry-run check
1 parent 7fbc831 commit cbc73d4

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

.github/actions/build-and-publish-docker/action.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,31 @@ inputs:
1010
dry_run:
1111
description: If set, generate the docker image but don't publish it
1212
required: true
13-
type: boolean
13+
registry:
14+
description: 'The docker registry'
15+
required: true
16+
username:
17+
description: 'The docker username'
18+
required: true
19+
password:
20+
description: 'The docker password'
21+
required: true
1422
runs:
1523
using: "composite"
16-
env:
17-
SONATYPE_FALLBACK: 1
1824
steps:
1925
- name: Log in to the Elastic Container registry
2026
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
2127
with:
22-
registry: ${{ secrets.ELASTIC_DOCKER_REGISTRY }}
23-
username: ${{ secrets.ELASTIC_DOCKER_USERNAME }}
24-
password: ${{ secrets.ELASTIC_DOCKER_PASSWORD }}
28+
registry: ${{ inputs.registry }}
29+
username: ${{ inputs.username }}
30+
password: ${{ inputs.password }}
2531

2632
- name: "Build docker image"
2733
shell: bash
2834
run: ./scripts/docker-release/build_docker.sh "${{ inputs.release_version }}"
35+
env:
36+
SONATYPE_FALLBACK: 1
2937
- name: "Push docker image"
30-
if: ${{ ! inputs.dry_run }}
38+
if: ${{ inputs.dry_run == 'false' }}
3139
shell: bash
3240
run: ./scripts/docker-release/push_docker.sh "${{ inputs.release_version }}"

.github/workflows/regenerate-docker-images.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ jobs:
3939
release_version: ${{ inputs.version }}
4040
ref: ${{ inputs.ref }}
4141
dry_run: ${{ inputs.dry_run }}
42+
registry: ${{ secrets.ELASTIC_DOCKER_REGISTRY }}
43+
username: ${{ secrets.ELASTIC_DOCKER_USERNAME }}
44+
password: ${{ secrets.ELASTIC_DOCKER_PASSWORD }}

.github/workflows/release-step-3.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ jobs:
139139
release_version: "${{ env.RELEASE_VERSION }}"
140140
ref: ${{ inputs.ref }}
141141
dry_run: ${{ inputs.dry_run }}
142+
registry: ${{ secrets.ELASTIC_DOCKER_REGISTRY }}
143+
username: ${{ secrets.ELASTIC_DOCKER_USERNAME }}
144+
password: ${{ secrets.ELASTIC_DOCKER_PASSWORD }}
142145

143146
publish-aws-lambda:
144147
name: "Publish AWS Lambda"

0 commit comments

Comments
 (0)