Skip to content

Merge pull request #243 from gen-mind/docs/teams-integration #14

Merge pull request #243 from gen-mind/docs/teams-integration

Merge pull request #243 from gen-mind/docs/teams-integration #14

name: Build migration service
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# on:
# push:
# tags:
# - '*'
on:
push:
branches:
- main
paths:
- 'src/backend/migration/**'
- '.github/workflows/migration-service-build.yml'
env:
RGNAME: AKS_RG
ACRNAME: cognixacr
AKSNAME: Cognix_AKS
GITHUB_SHA: ${{ github.sha }}
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Migration Service Image Docker Build and Push
uses: docker/build-push-action@v2
with:
context: ./src/backend/migration
file: ./src/backend/migration/Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ env.ACRNAME }}.azurecr.io/cognix/migrationservice:${{env.GITHUB_SHA}}
build-args: |
COGNIX_VERSION=${{env.GITHUB_SHA}}
- name: Login to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Get AKS kubeconfig
run: az aks get-credentials --resource-group $RGNAME --name $AKSNAME
- name: Update migration server manifest
run:
sed -ie "s/migrationservice:main/migrationservice:${{env.GITHUB_SHA}}/g" ./src/backend/migration/migration-service-deployment.yaml
- name: Deploy migration server manifests
run: |
kubectl apply -f ./src/backend/migration/migration-service-deployment.yaml
- name: Delete migration server pod
run: |
kubectl rollout restart deploy/migrationservice
# - name: Login to Azure
# uses: azure/login@v1
# with:
# creds: ${{ secrets.AZURE_CREDENTIALS }}
#
# - name: Get AKS kubeconfig
# run: az aks get-credentials --resource-group $RGNAME --name $AKSNAME
#
# - name: Deploy API server manifests
# run: |
# kubectl rollout restart deploy/apiservice