-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (68 loc) · 1.89 KB
/
cd.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
name: Publish Docker image
on: push
jobs:
build:
strategy:
fail-fast: false
matrix:
bots:
- PoliNetworkBot
name: Docker Build
runs-on: ubuntu-latest
outputs:
docker_image_tag: ${{ steps.meta.outputs.tags }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
submodules: recursive
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
polinetwork/${{ matrix.bots }}
tags: |
type=sha
- name: Build
uses: docker/build-push-action@v3
with:
push: ${{ github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main'}}
context: ${{ matrix.bots }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Update-K8s-Manifests-Dev:
name: Update K8s Deployment Manifest with Image Version
needs: build
if: ${{ github.ref == 'refs/heads/dev'}}
strategy:
fail-fast: false
matrix:
bots:
- PoliNetworkBot
uses: ./.github/workflows/cd-slave.yaml
with:
docker_image_tag: ${{needs.build.outputs.docker_image_tag}}
app: newbot
environment: dev
secrets:
CD_DEPLOY_KEY: ${{ secrets.CD_DEPLOY_KEY }}
Update-K8s-Manifests-Prod:
name: Update K8s Deployment Manifest with Image Version
needs: build
if: ${{github.ref == 'refs/heads/main'}}
strategy:
fail-fast: false
matrix:
bots:
- PoliNetworkBot
uses: ./.github/workflows/cd-slave.yaml
with:
docker_image_tag: ${{needs.build.outputs.docker_image_tag}}
app: newbot
environment: prod
secrets:
CD_DEPLOY_KEY: ${{ secrets.CD_DEPLOY_KEY }}