Skip to content

Commit

Permalink
Merge pull request #12 from matzegebbe/feat/showVersionOnStartup
Browse files Browse the repository at this point in the history
Feat/show version on startup
  • Loading branch information
matzegebbe authored Aug 20, 2023
2 parents 0e60b6b + f740dea commit b88b379
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
21 changes: 7 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Docker Login
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Go
uses: actions/setup-go@v4

Expand All @@ -24,17 +31,3 @@ jobs:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Docker Login
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }}
16 changes: 16 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,19 @@ archives:
release:
draft: false
prerelease: false

dockers:
- id: linux-amd64
goos: linux
goarch: amd64
dockerfile: Dockerfile-goreleaser
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.name={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.source={{ .GitURL }}"
- "--platform=linux/amd64"
image_templates:
- "ghcr.io/matzegebbe/web-jwks-validator:v{{ .Version }}"
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ type CustomClaims struct {

var (
jwksCache = Cache{}
version = "dev"
commit = "none"
date = "unknown"
)

func main() {
log.Printf("VERSION %s, COMMIT %s, BUILD AT %s", version, commit, date)

port := GetPortFromEnv()
jwksUrl := GetJwksURLFromEnv()
Expand Down

0 comments on commit b88b379

Please sign in to comment.