Skip to content

Commit 5b4a9d3

Browse files
authored
💚 correct image release action (#70)
* 💚 correct release image taging and test on branch * 💚 correct release tag env var * 💚 revert trigger on tag only
1 parent e893d09 commit 5b4a9d3

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,26 @@ jobs:
4141
- name: Check out the repo
4242
uses: actions/checkout@v2
4343

44-
- name: Get release tag and save in env var
44+
- name: Get and save release tag
4545
run: echo "::set-env name=RELEASE_TAG::${GITHUB_REF##*/}"
4646

47+
- name: Build and save image release tag
48+
run: echo "::set-env name=IMAGE_RELEASE_TAG::r${RELEASE_TAG}-${IMAGE_TAG}"
49+
4750
- name: Build image
48-
run: docker image build . --file Dockerfile --build-arg TERRAFORM_VERSION=$TF_VERSION --build-arg AWS_CLI_VERSION=$AWS_CLI_VERSIOIN --tag $ORGANIZATION/$IMAGE_NAME:$RELEASE_TAG-$IMAGE_TAG
51+
run: docker image build . --file Dockerfile --build-arg TERRAFORM_VERSION=$TF_VERSION --build-arg AWS_CLI_VERSION=$AWS_CLI_VERSIOIN --tag $ORGANIZATION/$IMAGE_NAME:$IMAGE_RELEASE_TAG
4952

5053
- name: Login to Docker Hub registry
5154
run: echo '${{ secrets.DOCKERHUB_PASS }}' | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
5255

5356
- name: Push image to registry
54-
run: docker push $ORGANIZATION/$IMAGE_NAME:$RELEASE_TAG-$IMAGE_TAG
57+
run: docker push $ORGANIZATION/$IMAGE_NAME:$IMAGE_RELEASE_TAG
5558

5659
- name: Save image
57-
run: docker image save -o $IMAGE_NAME-$RELEASE_TAG-$IMAGE_TAG.tar $ORGANIZATION/$IMAGE_NAME:r$RELEASE_TAG-$IMAGE_TAG
60+
run: docker image save -o $IMAGE_NAME-$RELEASE_TAG-$IMAGE_TAG.tar $ORGANIZATION/$IMAGE_NAME:$IMAGE_RELEASE_TAG
5861

5962
- name: Upload image artifact
6063
uses: actions/upload-artifact@v2
6164
with:
62-
name: ${{ env.IMAGE_NAME }}-${{ env.RELEASE_TAG }}-${{ env.IMAGE_TAG }}
63-
path: ${{ env.IMAGE_NAME }}-${{ env.RELEASE_TAG }}-${{ env.IMAGE_TAG }}.tar
65+
name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_RELEASE_TAG }}
66+
path: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_RELEASE_TAG }}.tar

0 commit comments

Comments
 (0)