-
Notifications
You must be signed in to change notification settings - Fork 10
55 lines (48 loc) · 1.74 KB
/
build-and-deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
on:
push:
branches:
- master
name: Build Docker image and deploy it to Kubernetes cluster
jobs:
deploy:
name: Build-Deploy
runs-on: ubuntu-latest
environment: production
env:
AWS_REGION: us-east-1
CLUSTER_NAME: maker-prod
DOCKER_IMAGE_REGISTRY: makerdao/chief-keeper
DOCKER_IMAGE_TAG: latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build, tag, and push image to Dockerhub
id: build-image
run: |
docker build -t ${{ env.DOCKER_IMAGE_REGISTRY }} .
docker tag ${{ env.DOCKER_IMAGE_REGISTRY }} ${{ env.DOCKER_IMAGE_REGISTRY }}:${{ env.DOCKER_IMAGE_TAG }}
docker push ${{ env.DOCKER_IMAGE_REGISTRY }}:${{ env.DOCKER_IMAGE_TAG }}
- name: Deploying app to Kubernetes with Helm
uses: bitovi/[email protected]
with:
values: image.repository=${{ env.DOCKER_IMAGE_REGISTRY }},image.tag=${{ env.DOCKER_IMAGE_TAG }}
cluster-name: ${{ env.CLUSTER_NAME }}
config-files: deploy/production/chief-keeper.yaml
chart-path: techops-services/common
namespace: keepers
timeout: 5m0s
name: chief-keeper
chart-repository: https://techops-services.github.io/helm-charts
version: 0.0.14
atomic: true