Skip to content

Commit

Permalink
Merge pull request #127 from hypersign-protocol/develop
Browse files Browse the repository at this point in the history
update ci-cd
  • Loading branch information
Pratap2018 authored Dec 18, 2023
2 parents b684a32 + e568ce0 commit 084481e
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 2 deletions.
43 changes: 43 additions & 0 deletions .deploy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,46 @@ spec:
- port: __PORT__
targetPort: __PORT__
protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-entity
namespace: hypermine-development
spec:
replicas: 1

selector:
matchLabels:
app: nginx-entity
template:
metadata:
labels:
app: nginx-entity
spec:
containers:
- name: nginx-entity
image: __GOOGLE_ARTIFACT_URL__/__GOOGLE_PROJECT_ID__/__GOOGLE_ARTIFACT_REPO__/nginx-enity:latest
resources:
limits:
memory: "256m"
cpu: "500m"
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: nginx-entity-service
namespace: hypermine-development
annotations:
cloud.google.com/neg: '{"ingress": true}'

spec:
type: NodePort
selector:
app: nginx-entity
ports:
- port: 8080
targetPort: 8080
protocol: TCP
9 changes: 9 additions & 0 deletions .github/workflows/CI-CD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ jobs:
docker build -t $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/enity-api-service:latest .

docker push $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/enity-api-service:latest
- name: "Docker Build and Push"
env:
GOOGLE_PROJECT_ID: ${{secrets.GOOGLE_PROJECT_ID}}
GOOGLE_ARTIFACT_URL: ${{secrets.GOOGLE_ARTIFACT_URL}}
GOOGLE_ARTIFACT_REPO: ${{secrets.GOOGLE_ARTIFACT_REPO}}
run:
docker build -t $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/nginx-entity:latest ./nginx/

docker push $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/nginx-entity:latest

Deploy:
needs: [Build]
Expand Down
8 changes: 8 additions & 0 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM nginx:latest





COPY nginx.conf /etc/nginx/nginx.conf
CMD ["nginx", "-g", "daemon off;"]
4 changes: 2 additions & 2 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ http {

server {
listen 8080;
server_name localhost *.localhost;
server_name entity-stage.hypersign.id *.entity-stage.hypersign.id;

set $subdomain "";
if ($host ~ ^(.*)\.localhost$) {
set $subdomain $1;
}

location / {
proxy_pass http://ssi-api:3001;
proxy_pass http://entity-api-service.hypermine-development.svc.cluster.local:3001;
proxy_set_header X-Subdomain $subdomain;
}

Expand Down

0 comments on commit 084481e

Please sign in to comment.