build: update container latest tag when releasing

This commit is contained in:
Luke K 2020-07-28 14:52:49 +00:00
parent 0810d9ace4
commit cc016db990
No known key found for this signature in database
GPG Key ID: 4896F75BAF2E1966
2 changed files with 15 additions and 7 deletions

View File

@ -23,7 +23,9 @@ jobs:
env:
USER: ${{ secrets.QUAY_USERNAME }}
PASS: ${{ secrets.QUAY_PASSWORD }}
run: docker login -u "$USER" -p "$PASS" quay.io && make push
run: |
docker login -u "$USER" -p "$PASS" quay.io
make push && make latest
- name: Compress Release Binary
run: gzip ./faas
- name: Create Release

View File

@ -17,21 +17,27 @@ test:
go test -cover -coverprofile=coverage.out ./...
image: Dockerfile
docker build -t $(REPO):$(VERS) \
docker build -t $(REPO):latest \
-t $(REPO):$(VERS) \
-t $(REPO):$(HASH) \
-t $(REPO):$(DATE)-$(VERS)-$(HASH) .
push: image
docker push $(REPO):$(VERS)
docker push $(REPO):$(HASH)
docker push $(REPO):$(DATE)-$(VERS)-$(HASH)
release: build test
go get -u github.com/git-chglog/git-chglog/cmd/git-chglog
git-chglog --next-tag $(VTAG) -o CHANGELOG.md
git commit -am "release: $(VTAG)"
git tag $(VTAG)
push: image
docker push $(REPO):$(VERS)
docker push $(REPO):$(HASH)
docker push $(REPO):$(DATE)-$(VERS)-$(HASH)
latest:
# push the local 'latest' tag as the new public latest version
# (run by CI only for releases)
docker push $(REPO):latest
clean:
-@rm -f $(BIN)
-@rm -f coverage.out