diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8f50e1f..9ae3af9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,18 +15,18 @@ jobs: steps: - name: set env BUILD_BRANCH run: echo "BUILD_BRANCH=$(echo $GITHUB_REF | sed 's:refs/heads/::')" >> $GITHUB_ENV - + - name: set branch prefix env to be used during docker build, .e.g. "refs/heads/testnet" => ".testnet" run: echo "BUILD_BRANCH_ENV_PREFIX=$(echo .$BUILD_BRANCH)" >> $GITHUB_ENV - + - name: set env PROJECT_NAME run: echo "PROJECT_NAME=$(echo $GITHUB_REPOSITORY | sed "s:MinterTeam/::")" >> $GITHUB_ENV - + - name: set env INGRESS_DOMAIN env: INGRESS_DOMAIN_KEY: INGRESS_DOMAIN_${{ env.BUILD_BRANCH }} run: echo "INGRESS_DOMAIN=$(echo ${!INGRESS_DOMAIN_KEY})" >> $GITHUB_ENV - + - name: set env KUBE_NAMESPACE env: KUBE_NAMESPACE_KEY: KUBE_NAMESPACE_${{ env.BUILD_BRANCH }} @@ -45,22 +45,22 @@ jobs: DOCKERFILE: ".docker/Dockerfile" DOCKER_BUILD_ARGS: --build-arg BUILD_BRANCH_ENV_PREFIX - - name: DigitalOcean Kubernetes - if: env.BUILD_BRANCH == env.PRODUCTION_BRANCH - uses: matootie/dokube@v1.3.4 - with: - personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }} - clusterName: k8s-prod-do - - - name: Install helm to DO - if: env.BUILD_BRANCH == env.PRODUCTION_BRANCH - run: wget https://get.helm.sh/helm-v3.3.4-linux-amd64.tar.gz &> /dev/null && tar xvzf helm-v3.3.4-linux-amd64.tar.gz && chmod 777 linux-amd64/helm && ./linux-amd64/helm ls -n ${{ env.KUBE_NAMESPACE }} - - - name: Deploy to DO - if: env.BUILD_BRANCH == env.PRODUCTION_BRANCH - env: - TAG_NAME: ${{ github.sha }} - run: ./linux-amd64/helm upgrade -n ${{ env.KUBE_NAMESPACE }} -i $PROJECT_NAME chart/ --atomic --timeout 100s --set image.tag=$TAG_NAME --set ingress.domain=$INGRESS_DOMAIN --set ingress.tlsname=$INGRESS_DOMAIN +# - name: DigitalOcean Kubernetes +# if: env.BUILD_BRANCH == env.PRODUCTION_BRANCH +# uses: matootie/dokube@v1.3.4 +# with: +# personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }} +# clusterName: k8s-prod-do +# +# - name: Install helm to DO +# if: env.BUILD_BRANCH == env.PRODUCTION_BRANCH +# run: wget https://get.helm.sh/helm-v3.3.4-linux-amd64.tar.gz &> /dev/null && tar xvzf helm-v3.3.4-linux-amd64.tar.gz && chmod 777 linux-amd64/helm && ./linux-amd64/helm ls -n ${{ env.KUBE_NAMESPACE }} +# +# - name: Deploy to DO +# if: env.BUILD_BRANCH == env.PRODUCTION_BRANCH +# env: +# TAG_NAME: ${{ github.sha }} +# run: ./linux-amd64/helm upgrade -n ${{ env.KUBE_NAMESPACE }} -i $PROJECT_NAME chart/ --atomic --timeout 100s --set image.tag=$TAG_NAME --set ingress.domain=$INGRESS_DOMAIN --set ingress.tlsname=$INGRESS_DOMAIN - name: deploy to production cluster if: env.BUILD_BRANCH == env.PRODUCTION_BRANCH @@ -70,7 +70,7 @@ jobs: TAG_NAME: ${{ github.sha }} with: args: helm upgrade -n $KUBE_NAMESPACE -i $PROJECT_NAME chart/ --atomic --timeout 100s --set image.tag=$TAG_NAME --set ingress.domain=$INGRESS_DOMAIN --set ingress.tlsname=$INGRESS_DOMAIN - + - name: deploy to staging cluster if: env.BUILD_BRANCH != env.PRODUCTION_BRANCH uses: wahyd4/kubectl-helm-action@master @@ -79,7 +79,7 @@ jobs: TAG_NAME: ${{ github.sha }} with: args: helm upgrade -n $KUBE_NAMESPACE -i ${{ env.PROJECT_NAME }} chart/ --atomic --timeout 100s --set image.tag=$TAG_NAME --set ingress.domain=$INGRESS_DOMAIN --set ingress.tlsname=$INGRESS_DOMAIN --set ingress.issuer=letsencrypt-http --set ingress.clusterissuer="" - + - name: notification if: cancelled() == false uses: xinthink/action-telegram@v1.1