Skip to content

Commit

Permalink
Merge pull request #1783 from matter-labs/devops/enable-stage-ci
Browse files Browse the repository at this point in the history
enable stage ci pipepline back
  • Loading branch information
dennybaa authored Jul 27, 2021
2 parents bcc6e83 + fb6203c commit 4c1249b
Showing 1 changed file with 65 additions and 66 deletions.
131 changes: 65 additions & 66 deletions .github/workflows/deploy-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- breaking

env:
DEPLOY_APPS: -l name=server -l name=prover -l name=explorer
DEPLOY_APPS: -l name=server -l name=prover

jobs:
pre:
Expand Down Expand Up @@ -53,72 +53,71 @@ jobs:
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
zk docker push rust
## !!! TODO: fix stage and enable deployments back.
## !!! TODO: breaking deployment is not supported.
# deploy:
# name: Deploy to the Stage enviroment
# runs-on: [k8s, deployer, stage]
# needs: [pre, build-images]
# Reminder: when disabling the deploy stage - comment the whole job out!
deploy:
name: Deploy to the Stage enviroment
runs-on: [k8s, deployer, stage]
needs: [pre, build-images]

# container:
# image: dysnix/kubectl:v1.19-gcloud
container:
image: dysnix/kubectl:v1.19-gcloud

# env:
# KUBECONF: ${{ secrets.KUBECONF_STAGE }}
# IMAGE_TAG: ${{ needs.pre.outputs.shortRev }}
# HFENV: stage
env:
KUBECONF: ${{ secrets.KUBECONF_STAGE }}
IMAGE_TAG: ${{ needs.pre.outputs.shortRev }}
HFENV: stage

# steps:
# -
# name: Create ~/.kube/config
# run: mkdir -p ~/.kube && echo "$KUBECONF" | base64 -d > ~/.kube/config
# -
# name: Clone helm-infra
# uses: actions/checkout@v2
# with:
# repository: matter-labs/helm-infra
# path: helm-infra
# ref: master
# token: ${{ secrets.GH_TOKEN }}
# -
# uses: chrnorm/deployment-action@releases/v1
# name: Create GitHub deployment
# id: deployment
# with:
# token: "${{ github.token }}"
# environment: stage
# -
# name: Deploy apps
# working-directory: helm-infra
# run: |
# # copy helm plugins over (from dysnix/kubectl, don't forget)!!!
# cp -r /dysnix/kubectl/.local /dysnix/kubectl/.cache ~
steps:
-
name: Create ~/.kube/config
run: mkdir -p ~/.kube && echo "$KUBECONF" | base64 -d > ~/.kube/config
-
name: Clone helm-infra
uses: actions/checkout@v2
with:
repository: matter-labs/helm-infra
path: helm-infra
ref: master
token: ${{ secrets.GH_TOKEN }}
-
uses: chrnorm/deployment-action@releases/v1
name: Create GitHub deployment
id: deployment
with:
token: "${{ github.token }}"
environment: stage
-
name: Deploy apps
working-directory: helm-infra
run: |
# copy helm plugins over (from dysnix/kubectl, don't forget)!!!
cp -r /dysnix/kubectl/.local /dysnix/kubectl/.cache ~
# UPDATE_REPOS=y helmfile -e $HFENV repos
# helmfile -e $HFENV $DEPLOY_APPS apply --args "timeout 180s"
# -
# name: Update deployment status (success)
# if: success()
# uses: chrnorm/deployment-status@releases/v1
# with:
# token: ${{ github.token }}
# state: success
# deployment_id: ${{ steps.deployment.outputs.deployment_id }}
# -
# name: Update deployment status (failure)
# if: failure()
# uses: chrnorm/deployment-status@releases/v1
# with:
# token: ${{ github.token }}
# state: failure
# deployment_id: ${{ steps.deployment.outputs.deployment_id }}
# -
# name: Notify to Mattermost (on failure)
# uses: tferreira/matterfy@releases/v1
# if: failure()
# with:
# type: ${{ job.status }}
# job_name: '*Deployment to stage failed*'
# icon_emoji: octocat
# channel: 'matterlabs-alerts'
# url: ${{ secrets.MATTERMOST_WEBHOOK }}
UPDATE_REPOS=y helmfile -e $HFENV repos
helmfile -e $HFENV $DEPLOY_APPS apply --args "timeout 180s"
-
name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@releases/v1
with:
token: ${{ github.token }}
state: success
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
-
name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@releases/v1
with:
token: ${{ github.token }}
state: failure
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
-
name: Notify to Mattermost (on failure)
uses: tferreira/matterfy@releases/v1
if: failure()
with:
type: ${{ job.status }}
job_name: '*Deployment to stage failed*'
icon_emoji: octocat
channel: 'matterlabs-alerts'
url: ${{ secrets.MATTERMOST_WEBHOOK }}

0 comments on commit 4c1249b

Please sign in to comment.