-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (44 loc) · 1.44 KB
/
build-production.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
41
42
43
44
45
46
47
48
49
50
51
52
name: Production Build Workflow
on:
push:
tags:
- "v*.*.*"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set most recent tag
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- uses: docker/login-action@v1
name: Login to DockerHub
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v2.7.0
name: Build and Push the Docker Image
id: docker_build
with:
push: true
tags: orgsinfo/cannon:${{ steps.vars.outputs.tag }}
- name: Docker Image Digest
run: echo ${{ steps.docker_build.outputs.digest }}
deploy:
needs: docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set most recent tag
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Deploy the app to the cluster
uses: nickgronow/kubectl@master
with:
config_data: ${{ secrets.KUBE_CONFIG_DATA }}
args: set image deployment/cannon-production cannon-prod-app=orgsinfo/cannon:${{ steps.vars.outputs.tag }} --namespace=production
- name: Verify deployment
uses: nickgronow/kubectl@master
with:
config_data: ${{ secrets.KUBE_CONFIG_DATA }}
args: rollout status deployment/cannon-production --namespace=production