-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
693c8df
commit 05e549b
Showing
19 changed files
with
269 additions
and
82 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
APP_PORT=8080 | ||
ALLOW_ORIGIN="http://localhost:8080" | ||
TRUSTED_PROXY="localhost" |
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,10 @@ | ||
name: Pull Request | ||
|
||
on: | ||
pull_request: | ||
branches: ["*"] | ||
jobs: | ||
test: | ||
uses: ./.github/workflows/reusable-test.yml | ||
docstest: | ||
uses: ./.github/workflows/reusable-docstest.yml |
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,13 @@ | ||
name: Push | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
jobs: | ||
test: | ||
uses: ./.github/workflows/reusable-test.yml | ||
docstest: | ||
uses: ./.github/workflows/reusable-docstest.yml | ||
release: | ||
needs: [test, docstest] | ||
uses: ./.github/workflows/reusable-release.yml |
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,25 @@ | ||
name: Docs Test | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
docstest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: Display Node.js version | ||
run: node --version | ||
|
||
- name: Install dependencies | ||
run: yarn global add @redocly/cli | ||
|
||
- name: Run docs build | ||
run: redocly build-docs docs/openapi/_index.yaml --output tmp/openapi-docs.html |
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,21 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Release new version | ||
uses: cycjimmy/semantic-release-action@v4 | ||
permissions: | ||
contents: write | ||
issues: write | ||
pull-requests: write | ||
id-token: write | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,31 @@ | ||
name: Test | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.21.5 | ||
|
||
- name: Setup dependencies | ||
run: make setup | ||
|
||
- name: Run go format | ||
run: make format | ||
|
||
- name: Run go lint | ||
run: make lint | ||
|
||
- name: Run go build | ||
run: make build | ||
|
||
- name: Run go test | ||
run: make test |
This file was deleted.
Oops, something went wrong.
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,42 @@ | ||
{ | ||
"branches": [ | ||
{ | ||
"name": "release", | ||
"prerelease": false | ||
}, | ||
{ | ||
"name": "main", | ||
"prerelease": true | ||
} | ||
], | ||
"plugins": [ | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
"releaseRules": [ | ||
{ | ||
"type": "docs", | ||
"scope": "README", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "refactor", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "style", | ||
"release": "patch" | ||
} | ||
], | ||
"parserOpts": { | ||
"noteKeywords": [ | ||
"BREAKING CHANGE", | ||
"BREAKING CHANGES" | ||
] | ||
} | ||
} | ||
], | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/github" | ||
] | ||
} |
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,27 @@ | ||
FROM golang:1.21-alpine AS builder | ||
|
||
WORKDIR /app | ||
COPY cmd/ cmd/ | ||
COPY internal/ internal/ | ||
COPY go.sum go.sum | ||
COPY go.mod go.mod | ||
|
||
RUN go build -o app cmd/app/main.go | ||
|
||
|
||
FROM scratch AS runner | ||
|
||
ARG ENVIRONMENT | ||
ARG ALLOW_ORIGIN | ||
ARG TRUSTED_PROXY | ||
|
||
ENV GIN_MODE=release \ | ||
ENVIRONMENT=$ENVIRONMENT \ | ||
ALLOW_ORIGIN=$ALLOW_ORIGIN \ | ||
TRUSTED_PROXY=$TRUSTED_PROXY | ||
|
||
COPY --from=builder /app/app /app/app | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["/app/app"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
steps: | ||
- name: "gcr.io/cloud-builders/docker" | ||
args: | ||
[ | ||
"build", | ||
"-t", | ||
"gcr.io/$PROJECT_ID/$_SERVICE_NAME:$TAG_NAME", | ||
"--build-arg", | ||
"ALLOW_ORIGIN=$_ALLOW_ORIGIN", | ||
"--build-arg", | ||
"TRUSTED_PROXY=$_TRUSTED_PROXY", | ||
"--build-arg", | ||
"ENVIRONMENT=$_ENVIRONMENT", | ||
".", | ||
] | ||
|
||
- name: "gcr.io/cloud-builders/docker" | ||
args: ["push", "gcr.io/$PROJECT_ID/$_SERVICE_NAME:$TAG_NAME"] | ||
|
||
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk" | ||
entrypoint: gcloud | ||
args: | ||
[ | ||
"run", | ||
"deploy", | ||
"$_SERVICE_NAME", | ||
"--image", | ||
"gcr.io/$PROJECT_ID/$_SERVICE_NAME:$TAG_NAME", | ||
"--region", | ||
"$_REGION", | ||
] | ||
|
||
images: | ||
- "gcr.io/$PROJECT_ID/$_SERVICE_NAME:$TAG_NAME" | ||
|
||
substitutions: | ||
_SERVICE_NAME: knodeledge-api | ||
_REGION: us-central1 |
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
Oops, something went wrong.