Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/prod-orphan-domain-handler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Build and Deploy (prod)

on:
push:
branches: [ main ]

env:
SERVICE_NAME: orphan-domain-handler
NAMESPACE: kops-dev
CLUSTER_NAME: raramuri-tech
CLUSTER_PROJECT: raramuri-tech
GAR_PROJECT: raramuri-tech
GAR_REGISTRY: kops-dev

jobs:
dockerize:
runs-on: ubuntu-latest
name: 🐳 Dockerize

outputs:
image: ${{ steps.output-image.outputs.image }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.25.1'
- name: Get dependencies
run: |
go mod download

- name: Build
run: |
cd ./orphan-domain-handler
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -buildvcs=false -o main

- name: Login to GAR
uses: docker/login-action@v2
with:
registry: us-central1-docker.pkg.dev
username: _json_key
password: ${{ secrets.ORPHAN_DOMAIN_HANDLER_KOPS_DEV_DEPLOYMENT_KEY }}

- name: Build and Push Docker Image to GAR
uses: docker/build-push-action@v2
with:
push: true
context: ./orphan-domain-handler
file: ./DockerfileODH
tags:
us-central1-docker.pkg.dev/${{ env.GAR_PROJECT }}/${{ env.GAR_REGISTRY }}/${{ env.NAMESPACE }}/${{ env.SERVICE_NAME }}:${{ github.sha }}
- id: output-image
run:
echo "image=`echo us-central1-docker.pkg.dev/${{ env.GAR_PROJECT }}/${{ env.GAR_REGISTRY }}/${{ env.NAMESPACE }}/${{ env.SERVICE_NAME }}:${{ github.sha }}`" >> "$GITHUB_OUTPUT"

deployment:
runs-on: ubuntu-latest
needs: dockerize
name: 🚀 Deploy
env:
image: ${{ needs.dockerize.outputs.image }}

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Authorize to GCP service account
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.ORPHAN_DOMAIN_HANDLER_KOPS_DEV_DEPLOYMENT_KEY }}

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2

- name: Update Kubectl component
run: gcloud --quiet components update kubectl

- name: Set GCloud Project and Fetch Cluster Credentials
run:
gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --region=us-central1 --project=${{ env.CLUSTER_PROJECT }}

- name: Update Deployment Image
run:
kubectl set image deployment/${{ env.SERVICE_NAME }} ${{ env.SERVICE_NAME }}=${{ env.image }} --namespace ${{ env.NAMESPACE }}
83 changes: 83 additions & 0 deletions .github/workflows/stage-orphan-domain-handler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Build and Deploy for Go service

on:
push:
branches: [ development ]

env:
SERVICE_NAME: orphan-domain-handler
NAMESPACE: kops-dev-stg
CLUSTER_NAME: raramuri-tech
CLUSTER_PROJECT: raramuri-tech
GAR_PROJECT: raramuri-tech
GAR_REGISTRY: kops-dev

jobs:
dockerize:
runs-on: ubuntu-latest
name: 🐳 Dockerize

outputs:
image: ${{ steps.output-image.outputs.image }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.25.1'
- name: Get dependencies
run: |
go mod download

- name: Build
run: |
cd ./orphan-domain-handler
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -buildvcs=false -o main

- name: Login to GAR
uses: docker/login-action@v2
with:
registry: us-central1-docker.pkg.dev
username: _json_key
password: ${{ secrets.ORPHAN_DOMAIN_HANDLER_KOPS_DEV_STG_DEPLOYMENT_KEY }}

- name: Build and Push Docker Image to GAR
uses: docker/build-push-action@v2
with:
push: true
context: ./orphan-domain-handler
file: ./DockerfileODH
tags:
us-central1-docker.pkg.dev/${{ env.GAR_PROJECT }}/${{ env.GAR_REGISTRY }}/${{ env.NAMESPACE }}/${{ env.SERVICE_NAME }}:${{ github.sha }}
- id: output-image
run:
echo "image=`echo us-central1-docker.pkg.dev/${{ env.GAR_PROJECT }}/${{ env.GAR_REGISTRY }}/${{ env.NAMESPACE }}/${{ env.SERVICE_NAME }}:${{ github.sha }}`" >> "$GITHUB_OUTPUT"

deployment:
runs-on: ubuntu-latest
needs: dockerize
name: 🚀 Deploy
env:
image: ${{ needs.dockerize.outputs.image }}

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Authorize to GCP service account
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.ORPHAN_DOMAIN_HANDLER_KOPS_DEV_STG_DEPLOYMENT_KEY }}

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2

- name: Update Kubectl component
run: gcloud --quiet components update kubectl

- name: Set GCloud Project and Fetch Cluster Credentials
run:
gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --region=us-central1 --project=${{ env.CLUSTER_PROJECT }}

- name: Update Deployment Image
run:
kubectl set image deployment/${{ env.SERVICE_NAME }} ${{ env.SERVICE_NAME }}=${{ env.image }} --namespace ${{ env.NAMESPACE }}
12 changes: 12 additions & 0 deletions DockerfileODH
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM alpine:latest

# Copy only the required directories and files
COPY main ./main
COPY ./static /static


RUN chmod 777 /main

EXPOSE 8000

CMD ["/main"]
Empty file.
100 changes: 100 additions & 0 deletions orphan-domain-handler/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
module orphan-domain-handler

go 1.25.1

require gofr.dev v1.46.2

require (
cloud.google.com/go v0.120.0 // indirect
cloud.google.com/go/auth v0.16.5 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
cloud.google.com/go/compute/metadata v0.9.0 // indirect
cloud.google.com/go/iam v1.5.2 // indirect
cloud.google.com/go/pubsub v1.49.0 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/DATA-DOG/go-sqlmock v1.5.2 // indirect
github.com/XSAM/otelsql v0.40.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dgraph-io/dgo/v210 v210.0.0-20230328113526-b66f8ae53a2d // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/eclipse/paho.mqtt.golang v1.5.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-sql-driver/mysql v1.9.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v5 v5.3.0 // indirect
github.com/google/s2a-go v0.1.9 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect
github.com/googleapis/gax-go/v2 v2.15.0 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/openzipkin/zipkin-go v0.4.3 // indirect
github.com/pierrec/lz4/v4 v4.1.22 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.23.2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.66.1 // indirect
github.com/prometheus/otlptranslator v1.0.0 // indirect
github.com/prometheus/procfs v0.17.0 // indirect
github.com/redis/go-redis/extra/rediscmd/v9 v9.14.0 // indirect
github.com/redis/go-redis/extra/redisotel/v9 v9.14.0 // indirect
github.com/redis/go-redis/v9 v9.14.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/segmentio/kafka-go v0.4.49 // indirect
github.com/stretchr/testify v1.11.1 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.63.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect
go.opentelemetry.io/otel v1.38.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.38.0 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.60.0 // indirect
go.opentelemetry.io/otel/exporters/zipkin v1.38.0 // indirect
go.opentelemetry.io/otel/metric v1.38.0 // indirect
go.opentelemetry.io/otel/sdk v1.38.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect
go.opentelemetry.io/otel/trace v1.38.0 // indirect
go.opentelemetry.io/proto/otlp v1.7.1 // indirect
go.uber.org/mock v0.6.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
golang.org/x/crypto v0.42.0 // indirect
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
golang.org/x/net v0.44.0 // indirect
golang.org/x/oauth2 v0.31.0 // indirect
golang.org/x/sync v0.17.0 // indirect
golang.org/x/sys v0.36.0 // indirect
golang.org/x/term v0.35.0 // indirect
golang.org/x/text v0.29.0 // indirect
golang.org/x/time v0.13.0 // indirect
google.golang.org/api v0.251.0 // indirect
google.golang.org/genproto v0.0.0-20250603155806-513f23925822 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250825161204-c5933d9347a5 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250929231259-57b25ae835d4 // indirect
google.golang.org/grpc v1.76.0 // indirect
google.golang.org/protobuf v1.36.10 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
modernc.org/libc v1.66.3 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.11.0 // indirect
modernc.org/sqlite v1.39.0 // indirect
)
Loading
Loading