-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (32 loc) · 1001 Bytes
/
deploy-auction.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
name: Deploy Auction Service
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'src/AuctionService/**'
env:
REGISTRY_IMAGE: knphilip/bidwheels-auction-svc
DOCKERFILE: src/AuctionService/Dockerfile
DEPLOYMENT_NAME: auction-svc
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Build and push the Docker image
uses: knphilip/actions/dockerfile-push@main
with:
context: "{{defaultContext}}"
tags: ${{ env.REGISTRY_IMAGE }}:latest
file: ${{ env.DOCKERFILE }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Save DigitalOcean kubeconfig
run: doctl kubernetes cluster kubeconfig save bidwheels
- name: Restart Kubernetes deployment
run: kubectl rollout restart deployment ${{ secrets.DEPLOYMENT_NAME }}