Skip to content

Commit 367c621

Browse files
fkiriakos07mansaj
authored andcommitted
use env to pass output parameters
1 parent 80dcf4c commit 367c621

File tree

5 files changed

+37
-15
lines changed

5 files changed

+37
-15
lines changed

.github/workflows/docker_build_deploy.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ jobs:
5959
- name: Deploy to Dockerhub
6060
env:
6161
DOCKERHUB_REPO: ${{ env.DOCKERHUB_REPO }}
62+
TAGS: ${{ steps.meta.outputs.tags }}
6263
run: |
6364
# deploy main
64-
docker tag blurts-server ${{ steps.meta.outputs.tags }}
65-
docker push ${{ steps.meta.outputs.tags }}
65+
docker tag blurts-server $TAGS
66+
docker push $TAGS

.github/workflows/docker_build_deploy_v2.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,7 @@ jobs:
8787
cache-to: type=gha,mode=max
8888

8989
- name: Print Image URI
90+
env:
91+
TAGS: ${{ steps.meta.outputs.tags }}
9092
run: |
91-
echo "Pushed GAR image: ${{ steps.meta.outputs.tags }}"
93+
echo "Pushed GAR image: $TAGS"

.github/workflows/release_cron_daily.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,22 @@ jobs:
8484
tags: type=sha,format=short,prefix=
8585

8686
- name: Pull Docker image from GAR with commit tag
87-
run: docker pull ${{ env.GAR_IMAGE_BASE }}:${{ steps.meta.outputs.version }}
87+
env:
88+
VERSION: ${{ steps.meta.outputs.version }}
89+
run: docker pull ${{ env.GAR_IMAGE_BASE }}:$VERSION
8890

8991
- name: Tag Docker image for Docker Hub with release tag
90-
run: docker tag ${{ env.GAR_IMAGE_BASE }}:${{ steps.meta.outputs.version }} ${{ env.DOCKERHUB_IMAGE }}:${{ env.CURRENT_DATE }}
92+
env:
93+
VERSION: ${{ steps.meta.outputs.version }}
94+
run: docker tag ${{ env.GAR_IMAGE_BASE }}:$VERSION ${{ env.DOCKERHUB_IMAGE }}:${{ env.CURRENT_DATE }}
9195

9296
- name: Push Docker image to Docker Hub with release tag
9397
run: docker push ${{ env.DOCKERHUB_IMAGE }}:${{ env.CURRENT_DATE }}
9498

9599
- name: Tag Docker image for GAR with release tag
96-
run: docker tag ${{ env.GAR_IMAGE_BASE }}:${{ steps.meta.outputs.version }} ${{ env.GAR_IMAGE_BASE }}:${{ env.CURRENT_DATE }}
100+
env:
101+
VERSION: ${{ steps.meta.outputs.version }}
102+
run: docker tag ${{ env.GAR_IMAGE_BASE }}:$VERSION ${{ env.GAR_IMAGE_BASE }}:${{ env.CURRENT_DATE }}
97103

98104
- name: Push Docker image to GAR with release tag
99105
run: docker push ${{ env.GAR_IMAGE_BASE }}:${{ env.CURRENT_DATE }}

.github/workflows/release_retag.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@ jobs:
3232
tags: type=sha,format=short,prefix=
3333

3434
- name: Pull Docker image with commit tag
35-
run: docker pull ${{ steps.meta.outputs.tags }}
35+
env:
36+
TAGS: ${{ steps.meta.outputs.tags }}
37+
run: docker pull $TAGS
3638

3739
- name: Tag Docker image with release tag
38-
run: docker tag ${{ steps.meta.outputs.tags }} mozilla/blurts-server:${{ github.ref_name }}
40+
env:
41+
TAGS: ${{ steps.meta.outputs.tags }}
42+
run: docker tag $TAGS mozilla/blurts-server:${{ github.ref_name }}
3943

4044
- name: Push Docker image with release tag
4145
run: docker push mozilla/blurts-server:${{ github.ref_name }}

.github/workflows/release_retag_v2.yaml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,29 @@ jobs:
5555
run: echo "name=${{ env.GAR_IMAGE_BASE }}:${{ github.ref_name }}" >> $GITHUB_OUTPUT
5656

5757
- name: Pull Docker image with commit tag from GAR
58+
env:
59+
TAGS: ${{ steps.meta.outputs.tags }}
5860
run: |
59-
echo "Pulling ${{ steps.meta.outputs.tags }}"
60-
docker pull ${{ steps.meta.outputs.tags }}
61+
echo "Pulling $TAGS"
62+
docker pull $TAGS
6163
6264
- name: Tag Docker image with release tag
65+
env:
66+
TAGS: ${{ steps.meta.outputs.tags }}
67+
NAME: ${{ steps.release_tag_info.outputs.name }}"
6368
run: |
64-
echo "Tagging ${{ steps.meta.outputs.tags }} as ${{ steps.release_tag_info.outputs.name }}"
65-
docker tag ${{ steps.meta.outputs.tags }} ${{ steps.release_tag_info.outputs.name }}
69+
echo "Tagging $TAGS as $NAME"
70+
docker tag $TAGS $NAME
6671
6772
- name: Push Docker image with release tag to GAR
73+
env:
74+
NAME: ${{ steps.release_tag_info.outputs.name }}"
6875
run: |
69-
echo "Pushing ${{ steps.release_tag_info.outputs.name }}"
70-
docker push ${{ steps.release_tag_info.outputs.name }}
76+
echo "Pushing $NAME"
77+
docker push $NAME
7178
7279
- name: Print Image URI
80+
env:
81+
NAME: ${{ steps.release_tag_info.outputs.name }}"
7382
run: |
74-
echo "Retagged and pushed GAR image: ${{ steps.release_tag_info.outputs.name }}"
83+
echo "Retagged and pushed GAR image: $NAME"

0 commit comments

Comments
 (0)