feat: add docker image on release and master (#135)

* feat: add docker image on release and master

* resolves return on the PR

* Add Installation docker doc

* Update .github/workflows/publish.yml

Co-authored-by: Derek Smith <derek@clokwork.net>

* Resovle PR conversations

* No v in RawVersion

Co-authored-by: Derek Smith <derek@clokwork.net>
This commit is contained in:
Anthony MARQUES 2021-04-01 17:41:35 +02:00 committed by GitHub
parent 8d9e00b699
commit 2307bff72f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 69 additions and 1 deletions

35
.github/workflows/publish.yml vendored Normal file
View file

@ -0,0 +1,35 @@
name: publish
on:
push:
branches:
- master
env:
GO_VERSION: "1.16"
DOCKER_REGISTRY: "quay.io"
jobs:
goreleaser:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Build go binary
run: make build
- name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v1
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ secrets.QUAY_IO_USER }}
password: ${{ secrets.QUAY_IO_TOKEN }}
- name: Build and Push docker image
run: |
docker build --pull --tag ${{ env.DOCKER_REGISTRY }}/git-chglog/git-chglog:edge .
docker push ${{ env.DOCKER_REGISTRY }}/git-chglog/git-chglog:edge

View file

@ -7,6 +7,7 @@ on:
env:
GO_VERSION: "1.16"
DOCKER_REGISTRY: "quay.io"
jobs:
goreleaser:
@ -22,7 +23,13 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v1
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ secrets.QUAY_IO_USER }}
password: ${{ secrets.QUAY_IO_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:

View file

@ -38,6 +38,11 @@ changelog:
snapshot:
name_template: "{{ .Tag }}-next"
dockers:
- image_templates:
- "quay.io/git-chglog/git-chglog:{{ .RawVersion }}"
- "quay.io/git-chglog/git-chglog:latest"
brews:
- tap:
owner: git-chglog

11
Dockerfile Normal file
View file

@ -0,0 +1,11 @@
FROM alpine:3.13.3
RUN apk add --no-cache git && \
mkdir /workdir
COPY git-chglog /usr/local/bin/git-chglog
WORKDIR /workdir
RUN chmod +x /usr/local/bin/git-chglog
ENTRYPOINT [ "/usr/local/bin/git-chglog" ]

View file

@ -112,6 +112,16 @@ asdf install git-chglog latest
go get -u github.com/git-chglog/git-chglog/cmd/git-chglog
```
### [Docker](https://www.docker.com/)
The compiled docker images are maintained on [quay.io](https://quay.io/repository/git-chglog/git-chglog).
We maintain the following tags:
- `edge`: Image that is build from the current `HEAD` of the main line branch.
- `latest`: Image that is built from the [latest released version](https://github.com/git-chglog/git-chglog/releases)
- `x.y.y` (versions): Images that are build from the tagged versions within Github.
```bash
docker pull quay.io/git-chglog/git-chglog:latest
docker run -v "$PWD":/workdir quay.io/git-chglog/git-chglog --version
```
---
If you are using another platform, you can download a binary from the [releases page]