Skip to content

Commit

Permalink
Merge pull request #10 from Silthus/master
Browse files Browse the repository at this point in the history
feat(release): publish docker image to docker hub
  • Loading branch information
StephanHCB authored Jun 25, 2022
2 parents 3800f55 + 9589b4f commit 482bcf1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,19 @@ jobs:
with:
go-version: 1.16
- run: go build
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: go-semantic-release/action@v1
with:
hooks: goreleaser
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
12 changes: 12 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ archives:
386: i386
amd64: x86_64
format: binary
dockers:
- image_templates:
- "StephanHCB/go-generator-cli:{{ .Tag }}"
- "StephanHCB/go-generator-cli:v{{ .Major }}"
- "StephanHCB/go-generator-cli:v{{ .Major }}.{{ .Minor }}"
- "StephanHCB/go-generator-cli:latest"
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM scratch
COPY go-generator-cli /
ENTRYPOINT ["/go-generator-cli"]

0 comments on commit 482bcf1

Please sign in to comment.