Skip to content

Commit 99faa79

Browse files
committed
chore(ops): setup basic http deployment via doks
1 parent 733d330 commit 99faa79

File tree

3 files changed

+21
-51
lines changed

3 files changed

+21
-51
lines changed

.github/workflows/publish.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@ jobs:
3131
username: ${{ github.actor }}
3232
password: ${{ secrets.GITHUB_TOKEN }}
3333

34-
# Install DO CLI
35-
- name: Install doctl
36-
uses: digitalocean/action-doctl@v2
37-
with:
38-
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
39-
40-
- name: Log in to DigitalOcean Container Registry with short-lived credentials
41-
run: doctl registry login --expiry-seconds 1200
42-
4334
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
4435
- name: Extract metadata (tags, labels) for Docker
4536
id: meta
@@ -56,17 +47,3 @@ jobs:
5647
push: true
5748
tags: ${{ steps.meta.outputs.tags }}
5849
labels: ${{ steps.meta.outputs.labels }}
59-
60-
deploy-to-cluster:
61-
steps:
62-
- name: Update deployment file
63-
run: TAG=$(echo $GITHUB_SHA | head -c7) && sed -i 's|<IMAGE>|${{ secrets.REGISTRY_NAME }}/${{ env.IMAGE_NAME }}:'${TAG}'|' $GITHUB_WORKSPACE/config/deployment.yml
64-
65-
- name: Save DigitalOcean kubeconfig with short-lived credentials
66-
run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 ${{ secrets.CLUSTER_NAME }}
67-
68-
- name: Deploy to DigitalOcean Kubernetes
69-
run: kubectl apply -f $GITHUB_WORKSPACE/config/deployment.yml
70-
71-
- name: Verify deployment
72-
run: kubectl rollout status deployment/${{ env.IMAGE_NAME }}

config/deployment.yml

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4-
name: services-proposals
5-
labels:
6-
app: services-proposals
4+
name: proposals
5+
namespace: default
76
spec:
87
replicas: 1
98
selector:
109
matchLabels:
11-
app: services-proposals
10+
app: proposals
1211
strategy:
1312
rollingUpdate:
1413
maxSurge: 1
@@ -17,29 +16,11 @@ spec:
1716
template:
1817
metadata:
1918
labels:
20-
app: services-proposals
19+
app: proposals
2120
spec:
2221
containers:
23-
- name: services-proposals
24-
image: <IMAGE>
25-
ports:
26-
- containerPort: 80
27-
resources:
28-
requests:
29-
cpu: 100m
30-
limits:
31-
cpu: 100m
32-
---
33-
# apiVersion: v1
34-
# kind: Service
35-
# metadata:
36-
# name: services-proposals
37-
# spec:
38-
# type: LoadBalancer
39-
# ports:
40-
# - name: http
41-
# protocol: TCP
42-
# port: 80
43-
# targetPort: 80
44-
# selector:
45-
# app: services-proposals
22+
- name: proposals
23+
image: ghcr.io/tulsawebdevs/services-proposals:release
24+
imagePullPolicy: Always
25+
ports:
26+
- containerPort: 3000

config/service.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: node-service
5+
namespace: default
6+
spec:
7+
type: LoadBalancer
8+
selector:
9+
app: proposals
10+
ports:
11+
- port: 80
12+
targetPort: 3000

0 commit comments

Comments
 (0)