diff --git a/.github/workflows/deploy-stage.yml b/.github/workflows/deploy-stage.yml index 070724ec45..ae5e1b16b2 100644 --- a/.github/workflows/deploy-stage.yml +++ b/.github/workflows/deploy-stage.yml @@ -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: @@ -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 }}