-
Notifications
You must be signed in to change notification settings - Fork 19
44 lines (34 loc) · 1.14 KB
/
deploy-payment.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
name: deploy-payment
on:
push:
# watch for pull request into main branch
branches:
- main
# watch for changes in payment folder
paths:
- "payment/**"
- "trigger-deploy.txt"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# build an image
- run: cd payment && docker build -t thasup/payment .
# login on docker hub
- run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
# push an image to docker hub
- run: docker push thasup/payment
# use and cliententicate doctl
- uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
# give credential to k8s cluster
- run: doctl kubernetes cluster kubeconfig save aurapan-cluster
# restart deployment
- run: kubectl rollout restart deployment payment-depl