-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,23 +18,23 @@ 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 }} | ||
run: echo "KUBE_NAMESPACE=$(echo ${!KUBE_NAMESPACE_KEY})" >> $GITHUB_ENV | ||
|
||
- uses: actions/checkout@v2 | ||
- name: build and push docker image | ||
uses: opspresso/[email protected] | ||
|
@@ -46,20 +46,20 @@ jobs: | |
TAG_NAME: ${{ github.sha }} | ||
DOCKERFILE: ".docker/Dockerfile" | ||
DOCKER_BUILD_ARGS: --build-arg BUILD_BRANCH_ENV_PREFIX | ||
|
||
- name: DigitalOcean Kubernetes | ||
uses: matootie/[email protected] | ||
with: | ||
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }} | ||
clusterName: k8s-prod-do | ||
|
||
- name: Install helm to DO | ||
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 $KUBE_NAMESPACE | ||
|
||
- name: Deploy to DO | ||
env: | ||
TAG_NAME: ${{ github.sha }} | ||
run: ./linux-amd64/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: DigitalOcean Kubernetes | ||
# uses: matootie/[email protected] | ||
# with: | ||
# personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }} | ||
# clusterName: k8s-prod-do | ||
# | ||
# - name: Install helm to DO | ||
# 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 $KUBE_NAMESPACE | ||
# | ||
# - name: Deploy to DO | ||
# env: | ||
# TAG_NAME: ${{ github.sha }} | ||
# run: ./linux-amd64/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 production cluster | ||
uses: wahyd4/[email protected] | ||
|
@@ -68,7 +68,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: notification | ||
if: cancelled() == false | ||
uses: xinthink/[email protected] | ||
|