Skip to content

Merge pull request #246 from sktston/feature/revert-more-log #136

Merge pull request #246 from sktston/feature/revert-more-log

Merge pull request #246 from sktston/feature/revert-more-log #136

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()