forked from openwallet-foundation/acapy
-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (82 loc) · 2.64 KB
/
docker_build_ncloud.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Python CI with Docker (NCLOUD)
on:
push:
branches:
- develop
paths-ignore:
- '.github/**'
workflow_dispatch:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
NCR_REGISTRY_PUBLIC: dev-did.ncr.fin-ntruss.com
NCR_REGISTRY_PRIVATE: r5p79moi.private-ncr.fin-ntruss.com
NCR_REPOSITORY: ston/aca-py
IMAGE_TAG: ${{ github.sha }}
DOCKERFILE_PATH: docker/Dockerfile.run-wait
jobs:
build-and-push-image:
runs-on: ubuntu-20.04
steps:
- name: Slack message - start
uses: act10ns/slack@v1
with:
status: starting
if: always()
- name: Checkout aries-cloudagent-python
uses: actions/checkout@v2
- name: Login to NCP Container Registry
id: log-in-to-ncr
uses: docker/login-action@v1
with:
registry: ${{ env.NCR_REGISTRY_PUBLIC }}
username: ${{ secrets.NCP_ACCESS_KEY_ID }}
password: ${{ secrets.NCP_SECRET_KEY }}
- name: Build, tag, and push image to NCP Container registry
id: build-and-push-to-ncr
run: |
docker build -f $DOCKERFILE_PATH -t $NCR_REGISTRY_PUBLIC/$NCR_REPOSITORY:$IMAGE_TAG .
docker push $NCR_REGISTRY_PUBLIC/$NCR_REPOSITORY:$IMAGE_TAG
- name: Slack messsae - end
uses: act10ns/slack@v1
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: always()
update-configuration:
needs: build-and-push-image
runs-on: ubuntu-20.04
concurrency: kustomize
steps:
- name: Slack message - start
uses: act10ns/slack@v1
with:
status: starting
if: always()
- name: Checkout ston-config
uses: actions/checkout@v2
with:
repository: sktston/ston-config
token: ${{ secrets.PAT }}
- name: Setup Kustomize
id: setup-kustomize
uses: imranismail/setup-kustomize@v1
with:
kustomize-version: "3.9.2"
- name: Update the image tag with Kustomize
id: update-config-with-kustomize
run: |
git config user.name github-actions
git config user.email [email protected]
git checkout ${GITHUB_REF##*/}
git pull origin ${GITHUB_REF##*/}
cd overlays/${GITHUB_REF##*/}
kustomize edit set image $NCR_REGISTRY_PRIVATE/$NCR_REPOSITORY:$IMAGE_TAG
git add kustomization.yaml
git commit -m "Deploying image $NCR_REGISTRY_PRIVATE/$NCR_REPOSITORY:$IMAGE_TAG"
git push origin ${GITHUB_REF##*/}
- name: Slack messsae - end
uses: act10ns/slack@v1
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: always()