Skip to content

Commit

Permalink
Merge pull request #17 from naturalett/naturalett/docker-tag-release
Browse files Browse the repository at this point in the history
Adding tag release for docker images
  • Loading branch information
leecalcote authored Jun 23, 2020
2 parents d5e835a + 3e2a0e7 commit a1712ce
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Learn Layer5
on:
push:
branches: [ master ]
tags:
- 'v*'
pull_request:
branches: [ master ]

Expand All @@ -25,5 +27,12 @@ jobs:
- name: Docker build & push
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success()
run: |
make build-img-service
make image-push
cd service && docker build --no-cache -t ${{ secrets.IMAGE_NAME }} .
docker tag ${{ secrets.IMAGE_NAME }}:latest ${{ secrets.IMAGE_NAME }}:${GITHUB_SHA::6}
docker push ${{ secrets.IMAGE_NAME }}:latest
docker push ${{ secrets.IMAGE_NAME }}:${GITHUB_SHA::6}
- name: Docker tag release & push
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
run: |
docker tag ${{ secrets.IMAGE_NAME }}:latest ${{ secrets.IMAGE_NAME }}:${GITHUB_REF/refs\/tags\//}
docker push ${{ secrets.IMAGE_NAME }}:${GITHUB_REF/refs\/tags\//}

0 comments on commit a1712ce

Please sign in to comment.