Skip to content

Admin Subscriptions, Update workspace name when org name is updated #77

Admin Subscriptions, Update workspace name when org name is updated

Admin Subscriptions, Update workspace name when org name is updated #77

name: Deploy to Production
on:
release:
types: [created]
jobs:
production_deploy:
runs-on: ubuntu-latest
environment: Production
steps:
- uses: actions/checkout@v2
- uses: satackey/[email protected]
continue-on-error: true
- name: push to dockerhub
uses: fylein/docker-release-action@master
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
IMAGE_NAME: fyle_qbo-api
- name: Deploy to Production
uses: fylein/aws-eks-deploy-action@master
env:
EKS_CLUSTER_NAME: ${{ secrets.EKS_CLUSTER_NAME }}
AWS_REGION: ${{ secrets.AWS_REGION }}
LOCAL_HOST: ${{ secrets.LOCAL_HOST }}
LOCAL_PORT: ${{ secrets.LOCAL_PORT }}
REMOTE_PORT: ${{ secrets.REMOTE_PORT }}
EKS_KUBECTL_ROLE: ${{ secrets.EKS_KUBECTL_ROLE }}
ROLE_SESSION_NAME: ${{ secrets.ROLE_SESSION_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
KUBERNETES_MANIFEST_FILE_PATH: deployment/production/controller.yml
- name: Install kustomize
run: |
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
sudo mv kustomize /usr/local/bin/
- name: Clone another repository
uses: actions/checkout@v2
with:
repository: ${{ secrets.PROD_DEPLOY_REPO }}
ref: master
path: ${{ secrets.PROD_DEPLOY_REPO }}
persist-credentials: false
token: ${{ secrets.DEPLOY_GIT_ACCESS_TOKEN }}
- name: Update Image Tag
run: |
NEW_TAG="v$(git rev-parse --short HEAD)"
cd ${{ secrets.PROD_DEPLOY_REPO }}/${{ secrets.EKS_CLUSTER_NAME }}/integrations
kustomize edit set image docker.io/${{ secrets.DOCKERHUB_USERNAME }}/fyle_qbo-api=docker.io/${{ secrets.DOCKERHUB_USERNAME }}/fyle_qbo-api:$NEW_TAG
- name: Commit and push changes
run: |
cd ${{ secrets.PROD_DEPLOY_REPO }}/
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git add .
git commit -m "Update image tag"
git remote set-url origin https://x-access-token:${{ secrets.DEPLOY_GIT_ACCESS_TOKEN }}@github.com/${{ secrets.PROD_DEPLOY_REPO }}
git pull origin master
git push origin master
- name: Create new Sentry release
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: fyle-technologies-private-limi
SENTRY_PROJECT: qbo-api
SENTRY_DEPLOY_ENVIRONMENT: production
run: |
# Install Sentry CLI
curl -sL https://sentry.io/get-cli/ | bash
# Create new Sentry release
export SENTRY_RELEASE=$(sentry-cli releases propose-version)
sentry-cli releases new -p $SENTRY_PROJECT $SENTRY_RELEASE
sentry-cli releases set-commits --auto $SENTRY_RELEASE
sentry-cli releases finalize $SENTRY_RELEASE
# Create new deploy for this Sentry release
sentry-cli releases deploys $SENTRY_RELEASE new -e $SENTRY_DEPLOY_ENVIRONMENT