Deploy to QA environment #167
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to QA environment | |
on: | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
working-directory: . | |
jobs: | |
deploy-to-qa: | |
if: github.repository == 'AOT-Technologies/forms-flow-ai' | |
runs-on: ubuntu-latest | |
environment: 'qa' | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 # Add this step to check out the repository | |
- name: Set version | |
if: ${{ github.ref != 'refs/heads/master' }} | |
working-directory: . | |
run: | | |
VER=$(cat VERSION) | |
echo "VERSION=$VER" >> $GITHUB_ENV | |
- name: Set version | |
if: ${{ github.ref == 'refs/heads/master' }} | |
working-directory: . | |
run: | | |
VER=$(cat VERSION) | |
VER=${VER/-alpha/''} | |
echo "VERSION=$VER" >> $GITHUB_ENV | |
- run: echo ${{ env.VERSION }} | |
- name: Set up AWS CLI | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_DEPLOYMENT_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_DEPLOYMENT_SECRET_ACCESS_KEY }} | |
aws-region: ca-central-1 # Change this to your desired region | |
- name: Install kubectl | |
run: | | |
curl -LO "https://dl.k8s.io/release/$(curl -Ls https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" | |
chmod +x kubectl | |
sudo mv kubectl /usr/local/bin/ | |
- name: Update Kube config | |
run: aws eks update-kubeconfig --region ca-central-1 --name ${{ secrets.QA_EKS_CLUSTER }} | |
- name: Deploy to QA | |
run: | | |
kubectl -n ${{ secrets.QA_OPENSOURCE_NAMESPACE }} patch deployment forms-flow-api -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-api","image":"docker.io/formsflow/forms-flow-webapi:${{ env.VERSION }}"}]}}}}' | |
kubectl -n ${{ secrets.QA_OPENSOURCE_NAMESPACE }} patch deployment forms-flow-bpm -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-bpm","image":"docker.io/formsflow/forms-flow-bpm:${{ env.VERSION }}"}]}}}}' | |
kubectl -n ${{ secrets.QA_OPENSOURCE_NAMESPACE }} patch deployment forms-flow-documents-api -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-documents-api","image":"docker.io/formsflow/forms-flow-documents-api:${{ env.VERSION }}"}]}}}}' | |
kubectl -n ${{ secrets.QA_OPENSOURCE_NAMESPACE }} patch deployment forms-flow-web -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-web","image":"docker.io/formsflow/forms-flow-web:${{ env.VERSION }}"}]}}}}' | |
kubectl rollout restart deployment forms-flow-api -n ${{ secrets.QA_OPENSOURCE_NAMESPACE }} | |
kubectl rollout restart deployment forms-flow-bpm -n ${{ secrets.QA_OPENSOURCE_NAMESPACE }} | |
kubectl rollout restart deployment forms-flow-documents-api -n ${{ secrets.QA_OPENSOURCE_NAMESPACE }} | |
kubectl rollout restart deployment forms-flow-web -n ${{ secrets.QA_OPENSOURCE_NAMESPACE }} | |
- name: Deploy to QA ee | |
run: | | |
kubectl -n ${{ secrets.QA_EE_NAMESPACE }} patch deployment forms-flow-api -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-api","image":"docker.io/formsflow/forms-flow-webapi-ee:${{ env.VERSION }}"}]}}}}' | |
kubectl -n ${{ secrets.QA_EE_NAMESPACE }} patch deployment forms-flow-bpm -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-bpm","image":"docker.io/formsflow/forms-flow-bpm-ee:${{ env.VERSION }}"}]}}}}' | |
kubectl -n ${{ secrets.QA_EE_NAMESPACE }} patch deployment forms-flow-documents-api -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-documents-api","image":"docker.io/formsflow/forms-flow-documents-api-ee:${{ env.VERSION }}"}]}}}}' | |
kubectl -n ${{ secrets.QA_EE_NAMESPACE }} patch deployment forms-flow-web -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-web","image":"docker.io/formsflow/forms-flow-web-ee:${{ env.VERSION }}"}]}}}}' | |
kubectl rollout restart deployment forms-flow-api -n ${{ secrets.QA_EE_NAMESPACE }} | |
kubectl rollout restart deployment forms-flow-bpm -n ${{ secrets.QA_EE_NAMESPACE }} | |
kubectl rollout restart deployment forms-flow-documents-api -n ${{ secrets.QA_EE_NAMESPACE }} | |
kubectl rollout restart deployment forms-flow-web -n ${{ secrets.QA_EE_NAMESPACE }} | |
- name: Deploy to QA multi | |
run: | | |
kubectl -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }} patch deployment forms-flow-api -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-api","image":"docker.io/formsflow/forms-flow-webapi-ee:${{ env.VERSION }}"}]}}}}' | |
kubectl -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }} patch deployment forms-flow-bpm -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-bpm","image":"docker.io/formsflow/forms-flow-bpm-ee:${{ env.VERSION }}"}]}}}}' | |
kubectl -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }} patch deployment forms-flow-documents-api -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-documents-api","image":"docker.io/formsflow/forms-flow-documents-api-ee:${{ env.VERSION }}"}]}}}}' | |
kubectl -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }} patch deployment forms-flow-web -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-web","image":"docker.io/formsflow/forms-flow-web-ee:${{ env.VERSION }}"}]}}}}' | |
kubectl -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }} patch deployment forms-flow-admin -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-admin","image":"docker.io/formsflow/forms-flow-ai-admin:${{ env.VERSION }}"}]}}}}' | |
kubectl rollout restart deployment forms-flow-api -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }} | |
kubectl rollout restart deployment forms-flow-bpm -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }} | |
kubectl rollout restart deployment forms-flow-documents-api -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }} | |
kubectl rollout restart deployment forms-flow-web -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }} | |
kubectl rollout restart deployment forms-flow-admin -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }} |