-
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
0 parents
commit 47811e3
Showing
42 changed files
with
4,342 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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 @@ | ||
* @KevinJoiner |
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,28 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
# Maintain dependencies for Go | ||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" | ||
groups: | ||
go-mod: | ||
patterns: | ||
- "*" | ||
|
||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
groups: | ||
actions: | ||
patterns: | ||
- "*" |
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,41 @@ | ||
name: buildpushdev | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
name: buildpushdev | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Get short SHA | ||
id: slug | ||
run: echo "::set-output name=sha7::$(echo ${GITHUB_SHA} | cut -c1-7)" | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: dimozone/fetch-api:${{ steps.slug.outputs.sha7 }}, dimozone/fetch-api:latest | ||
|
||
- name: Update Image Version in the worker HelmChart values.yaml | ||
uses: fjogeleit/yaml-update-action@master | ||
with: | ||
valueFile: "charts/fetch-api/values.yaml" | ||
propertyPath: "image.tag" | ||
value: ${{ steps.slug.outputs.sha7 }} | ||
branch: main | ||
message: "Update Image Version to ${{ steps.slug.outputs.sha7 }}" |
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,47 @@ | ||
name: buildpush | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
build_test: | ||
# The type of runner that the job will run on | ||
name: buildpush | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Get tag | ||
id: tag | ||
uses: dawidd6/action-get-tag@v1 | ||
with: | ||
strip_v: true | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
platforms: linux/amd64 | ||
tags: dimozone/fetch-api:${{steps.tag.outputs.tag}} | ||
|
||
- name: Update Image Version in the related HelmChart values.yaml | ||
uses: fjogeleit/yaml-update-action@v0.11.1 | ||
with: | ||
valueFile: "charts/fetch-api/values-prod.yaml" | ||
propertyPath: "image.tag" | ||
value: ${{steps.tag.outputs.tag}} | ||
branch: main | ||
message: "Update Image Version to ${{steps.tag.outputs.tag}}" |
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 @@ | ||
name: generate files | ||
on: | ||
pull_request: | ||
branches: ["**"] | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
generate: | ||
# Condition to skip merge commits | ||
if: "!contains(github.event.head_commit.message, 'Merge pull request')" | ||
runs-on: ubuntu-latest | ||
|
||
name: lint | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'go.mod' | ||
|
||
- name: go mod tidy | ||
run: go mod tidy | ||
|
||
- name: go mod verify | ||
run: go mod verify | ||
|
||
- name: install tools | ||
run: make tools | ||
|
||
- name: generate graphql files | ||
run: make generate | ||
|
||
- name: porcelain | ||
shell: bash | ||
run: | | ||
dirty_files="$(git status --porcelain)" | ||
if [[ `git status --porcelain` ]]; then | ||
echo "The following files are dirty after running generators:" | ||
echo "${dirty_files}" | ||
exit 1 | ||
fi |
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: lint | ||
on: | ||
pull_request: | ||
branches: ["**"] | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
lint: | ||
# Condition to skip merge commits | ||
if: "!contains(github.event.head_commit.message, 'Merge pull request')" | ||
runs-on: ubuntu-latest | ||
|
||
name: lint | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'go.mod' | ||
|
||
- name: Install golangci-lint | ||
run: make tools-golangci-lint | ||
|
||
- name: Run golangci-lint | ||
run: make lint |
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: test | ||
on: | ||
pull_request: | ||
branches: ["**"] | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
test: | ||
# Condition to skip merge commits | ||
if: "!contains(github.event.head_commit.message, 'Merge pull request')" | ||
runs-on: ubuntu-latest | ||
|
||
name: lint | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'go.mod' | ||
|
||
- name: mod verify | ||
run: go mod verify | ||
|
||
- name: Run Tests | ||
run: make 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,33 @@ | ||
# If you prefer the allow list template instead of the deny list, see community template: | ||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore | ||
# | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
bin/ | ||
__debug_bin* | ||
*.DS_Store | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Dependency directories (remove the comment below to include it) | ||
# vendor/ | ||
|
||
# Go workspace file | ||
go.work | ||
settings.yaml | ||
|
||
.idea | ||
.vscode/ | ||
__debug_bin* | ||
*.code-workspace | ||
.history/ | ||
|
||
|
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,23 @@ | ||
FROM golang:1.22 AS build | ||
|
||
RUN useradd -u 10001 dimo | ||
|
||
WORKDIR /build | ||
COPY . ./ | ||
|
||
RUN make tidy | ||
RUN make build | ||
|
||
FROM gcr.io/distroless/static AS final | ||
|
||
LABEL maintainer="DIMO <hello@dimo.zone>" | ||
|
||
USER nonroot:nonroot | ||
|
||
COPY --from=build --chown=nonroot:nonroot /build/bin/fetch-api / | ||
|
||
EXPOSE 8080 | ||
EXPOSE 8888 | ||
|
||
ENTRYPOINT ["/fetch-api"] | ||
|
Oops, something went wrong.