Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit f33dc43

Browse files
Merge pull request #263 from jim-deriv/Jim/FEQ-878/setup-docker-and-kubernetes-1
Jim/FEQ-878/setup-docker-and-kubernetes-1
2 parents 1a6d5a0 + 6308164 commit f33dc43

File tree

4 files changed

+30
-12
lines changed

4 files changed

+30
-12
lines changed

.github/actions/deploy_to_kubernetes/action.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,28 @@ inputs:
1111
CA_CRT:
1212
description: Kubernetes CA certificate
1313
required: true
14+
KUBE_SERVER:
15+
description: Kubernetes server
16+
required: true
17+
SERVICEACCOUNT_TOKEN:
18+
description: Kubernetes service account token
19+
required: true
1420
runs:
1521
using: composite
1622
steps:
23+
- name: Setup Environment variables
24+
run: |
25+
echo "NAMESPACE=${{ inputs.K8S_NAMESPACE }}" >> "$GITHUB_ENV"
26+
echo "KUBE_SERVER=${{ inputs.KUBE_SERVER }}" >> "$GITHUB_ENV"
27+
echo "SERVICEACCOUNT_TOKEN=${{ inputs.SERVICEACCOUNT_TOKEN }}" >> "$GITHUB_ENV"
28+
echo "CA_CRT=${{ inputs.CA_CRT }}" >> "$GITHUB_ENV"
29+
echo "APP_NAME=deriv-api-docs" >> "$GITHUB_ENV"
30+
shell: bash
1731
- name: Deploying to k8s cluster for service ${{ inputs.K8S_NAMESPACE }} 🚀
18-
run: |
19-
export NAMESPACE=${{ inputs.K8S_NAMESPACE }}
20-
git clone https://github.com/binary-com/devops-ci-scripts
21-
cd devops-ci-scripts/k8s-build_tools
22-
echo ${{ inputs.CA_CRT }} | base64 --decode > ca.crt
23-
export CA="ca.crt"
24-
./release.sh deriv-com-api ${{ inputs.K8S_VERSION }}
32+
run: |
33+
git clone https://github.com/binary-com/devops-ci-scripts
34+
cd devops-ci-scripts/k8s-build_tools
35+
echo ${{ inputs.CA_CRT }} | base64 --decode > ca.crt
36+
export CA="ca.crt"
37+
./release.sh ${APP_NAME} ${{ inputs.K8S_VERSION }}
2538
shell: bash

.github/actions/publish_to_docker/action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ inputs:
1717
DOCKERHUB_PASSWORD:
1818
description: Docker Hub password
1919
required: true
20-
runs:
20+
runs:
2121
using: composite
2222
steps:
2323
- name: Building docker image 🐳
@@ -26,13 +26,13 @@ runs:
2626
shell: bash
2727
- name: Verify nginx image
2828
run: |
29-
set -e
30-
docker run --rm ${{ inputs.DOCKERHUB_ORGANISATION }}/deriv-com-api:${{ inputs.DOCKER_LATEST_IMAGE_TAG }} nginx -t
31-
echo "docker image validated successfully"
29+
set -e
30+
docker run --rm ${{ inputs.DOCKERHUB_ORGANISATION }}/deriv-com-api:${{ inputs.DOCKER_LATEST_IMAGE_TAG }} nginx -t
31+
echo "docker image validated successfully"
3232
shell: bash
3333
- name: Pushing Image to docker hub 🐳
3434
run: |
35-
echo ${{ inputs.DOCKERHUB_PASSWORD }} | docker login -u $${{ inputs.DOCKERHUB_USERNAME }} --password-stdin
35+
echo ${{ inputs.DOCKERHUB_PASSWORD }} | docker login -u ${{ inputs.DOCKERHUB_USERNAME }} --password-stdin
3636
docker push ${{ inputs.DOCKERHUB_ORGANISATION }}/deriv-com-api:${{ inputs.DOCKER_IMAGE_TAG }}
3737
docker push ${{ inputs.DOCKERHUB_ORGANISATION }}/deriv-com-api:${{ inputs.DOCKER_LATEST_IMAGE_TAG }}
3838
shell: bash

.github/workflows/release_production.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ jobs:
4747
K8S_VERSION: ${{ github.ref_name }}
4848
K8S_NAMESPACE: 'deriv-com-api-production'
4949
CA_CRT: ${{ secrets.CA_CRT }}
50+
SERVICEACCOUNT_TOKEN: ${{ secrets.SERVICEACCOUNT_TOKEN }}
51+
KUBE_SERVER: ${{ secrets.KUBE_SERVER }}
52+
5053
send_slack_notification:
5154
name: Send Slack Notification
5255
environment: Production

.github/workflows/release_staging.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ jobs:
4040
K8S_VERSION: ${{ github.ref_name }}
4141
K8S_NAMESPACE: 'deriv-com-api-staging'
4242
CA_CRT: ${{ secrets.CA_CRT }}
43+
SERVICEACCOUNT_TOKEN: ${{ secrets.SERVICEACCOUNT_TOKEN }}
44+
KUBE_SERVER: ${{ secrets.KUBE_SERVER }}

0 commit comments

Comments
 (0)