-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
206 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "monday" | ||
time: "12:30" | ||
timezone: "Europe/Oslo" | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "monday" | ||
time: "12:30" | ||
timezone: "Europe/Oslo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Create and publish a Docker image | ||
|
||
on: | ||
push: | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: write | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Setup Golang environment | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21" | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@b4bedf8053341df3b5a9f9e0f2cf4e79e27360c6 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Release with Goreleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
pharos-job: | ||
name: Run Pharos with Required Permissions | ||
needs: build-and-push-image | ||
permissions: | ||
actions: read | ||
packages: read | ||
contents: read | ||
security-events: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Run Pharos" | ||
uses: kartverket/[email protected] | ||
with: | ||
image_url: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ github.ref_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Build and test PR | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
|
||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
mod: | ||
runs-on: ubuntu-latest | ||
name: Check modules | ||
steps: | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '>=1.21.0' | ||
check-latest: true | ||
- uses: actions/checkout@v3 | ||
- run: go mod tidy && git diff --exit-code go.mod go.sum | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
version: [ '1.21' ] | ||
name: Go ${{ matrix.version }} | ||
steps: | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.version }} | ||
- uses: actions/checkout@v3 | ||
- run: go vet ./... | ||
- run: go run github.com/onsi/ginkgo/v2/ginkgo -r --randomize-suites --race --trace --fail-on-pending --keep-going | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,5 +21,6 @@ | |
go.work | ||
|
||
.idea | ||
config.yaml | ||
smseagle-proxy | ||
cmd/config.yaml | ||
smseagle-proxy | ||
cmd/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
project_name: smseagle-proxy | ||
|
||
builds: | ||
- binary: smseagle-proxy | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
ldflags: | ||
- -extldflags "-static" | ||
tags: | ||
- timetzdata | ||
dir: cmd | ||
dockers: | ||
- dockerfile: 'Dockerfile' | ||
image_templates: | ||
- "ghcr.io/kartverket/{{ .ProjectName }}:{{ .Version }}" | ||
|
||
|
||
archives: | ||
- format: tar.gz | ||
# this name template makes the OS and Arch compatible with the results of `uname`. | ||
name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- title .Os }}_ | ||
{{- if eq .Arch "amd64" }}x86_64 | ||
{{- else if eq .Arch "386" }}i386 | ||
{{- else }}{{ .Arch }}{{ end }} | ||
{{- if .Arm }}v{{ .Arm }}{{ end }} | ||
# use zip for windows archives | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- "^docs:" | ||
- "^test:" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM golang:1.21 as builder | ||
RUN adduser -u 10001 scratchuser | ||
|
||
FROM scratch | ||
COPY smseagle-proxy / | ||
COPY --from=builder /etc/passwd /etc/passwd | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
USER scratchuser | ||
ENTRYPOINT ["/smseagle-proxy"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters