Skip to content

Commit b63e467

Browse files
authored
Create and push latest docker image during release (elastic#1848)
1 parent e373de8 commit b63e467

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,27 @@ jobs:
9999
with:
100100
name: build-distribution
101101
path: ./build
102+
- id: setup-docker
103+
name: Set up docker variables
104+
run: |-
105+
# version without v prefix (e.g. 1.2.3)
106+
echo "tag=${GITHUB_REF_NAME/v/}" >> "${GITHUB_OUTPUT}"
107+
echo "name=docker.elastic.co/observability/apm-agent-python" >> "${GITHUB_OUTPUT}"
102108
- name: Docker build
103109
run: >-
104110
docker build
105-
-t docker.elastic.co/observability/apm-agent-python:${GITHUB_REF_NAME/v/}
111+
-t ${{ steps.setup-docker.outputs.name }}:${{ steps.setup-docker.outputs.tag }}
106112
--build-arg AGENT_DIR=./build/dist/package/python
107113
.
114+
- name: Docker retag
115+
run: >-
116+
docker tag
117+
${{ steps.setup-docker.outputs.name }}:${{ steps.setup-docker.outputs.tag }}
118+
${{ steps.setup-docker.outputs.name }}:latest
108119
- name: Docker push
109-
run: docker push docker.elastic.co/observability/apm-agent-python:${GITHUB_REF_NAME/v/}
120+
run: |-
121+
docker push ${{ steps.setup-docker.outputs.name }}:${{ steps.setup-docker.outputs.tag }}
122+
docker push ${{ steps.setup-docker.outputs.name }}:latest
110123
111124
github-draft:
112125
permissions:

0 commit comments

Comments
 (0)