Skip to content

Commit

Permalink
feat(ci): set up ci
Browse files Browse the repository at this point in the history
  • Loading branch information
George-Spanos committed Aug 6, 2024
1 parent cf37222 commit 56ed3d9
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 1 deletion.
27 changes: 26 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,29 @@ jobs:
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ secrets.REPOSITORY_NAME }}/gaming-grid-creator:${{ github.sha }},${{ secrets.REPOSITORY_NAME }}/gaming-grid-creator:latest,
tags: ${{ secrets.REPOSITORY_NAME }}/gaming-grids-creator:${{ github.sha }},${{ secrets.REPOSITORY_NAME }}/gaming-grids-creator:latest,
deploy:
needs: [build]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: azure/setup-kubectl@v4
with:
version: "v1.30.1"
id: install
- uses: azure/k8s-set-context@v4
name: Set Context
with:
method: service-account
k8s-url: ${{ secrets.KUBE_DEV_SERVER_URL }}
k8s-secret: ${{ secrets.KUBE_SA_TOKEN_DEV }}
id: setcontext
- name: Apply k8s
uses: Azure/k8s-deploy@v5
with:
name: kubernetes
namespace: gaming-grids
images: ghcr.io/moby-it/gaming-grids-creator:${{ github.sha }}
action: deploy
manifests: |
k8s/app.yaml
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ COPY . .
RUN pnpm build

FROM build AS run

LABEL org.opencontainers.image.source https://github.com/moby-it/gaming-grids-creator
EXPOSE 3000
CMD ["node", ".output/server/index.mjs"]
1 change: 1 addition & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
services:
app:
restart: always
env_file: .env
image: ghcr.io/moby-it/gaming-grids-creator
ports:
- 46001:3000
2 changes: 2 additions & 0 deletions k8s/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
regcred.yaml
token.yaml
60 changes: 60 additions & 0 deletions k8s/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
apiVersion: v1
kind: Namespace
metadata:
name: gaming-grids
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gaming-grids-admin
namespace: gaming-grids
labels:
app.kubernetes.io/part-of: gaming-grids
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: gaming-grids-admin
template:
metadata:
labels:
app.kubernetes.io/name: gaming-grids-admin
app.kubernetes.io/part-of: gaming-grids
spec:
containers:
- image: ghcr.io/moby-it/gaming-grids-creator
imagePullPolicy: Always
name: gaming-grids-app
livenessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 15
periodSeconds: 20
ports:
- containerPort: 3000
name: container-port
resources:
requests:
memory: "128Mi"
cpu: "250m"
limits:
memory: "256Mi"
cpu: "500m"
imagePullSecrets:
- name: regcred
---
apiVersion: v1
kind: Service
metadata:
name: gaming-grids-creator
namespace: gaming-grids
spec:
selector:
app.kubernetes.io/name: gaming-grids-creator
ports:
- name: gaming-grids-creator-port
port: 80
targetPort: container-port
protocol: TCP
type: LoadBalancer
28 changes: 28 additions & 0 deletions k8s/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress
namespace: gaming-grids
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
acme.cert-manager.io/http01-edit-in-place: "true"
# nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
cert-manager.io/issuer: "letsencrypt-prod"

spec:
ingressClassName: nginx
tls:
- hosts:
- admin-league.mobyplaygrounds.com
secretName: admin-league-mobyplaygrounds-tls
rules:
- host: admin-league.mobyplaygrounds.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: gaming-grids-creator
port:
number: 80

0 comments on commit 56ed3d9

Please sign in to comment.