-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (36 loc) · 1.09 KB
/
deploy-gateway.yml
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
name: deploy-gateway
on:
workflow_dispatch:
push:
branches: [ "main" ]
paths:
- 'src/GatewayService/**'
env:
REGISTRY_IMAGE: trycatchlearn/gateway-svc
DOCKERFILE: src/GatewayService/Dockerfile
DEPLOYMENT_NAME: gateway-svc
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: docker/setup-buildx-action@v2
- name: Login to docker hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push the Docker image
uses: docker/build-push-action@v3
with:
context: "{{defaultContext}}"
file: ${{ env.DOCKERFILE }}
push: true
tags: ${{ env.REGISTRY_IMAGE }}:latest
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Save DigitalOcean kubeconfig
run: doctl kubernetes cluster kubeconfig save carsties
- name: Restart kubernetes deployment
run: kubectl rollout restart deployment ${{ env.DEPLOYMENT_NAME }}