Skip to content

Commit

Permalink
Merge pull request #2366 from matter-labs/remove-hubot
Browse files Browse the repository at this point in the history
Test wf dispatch instead of hubot
  • Loading branch information
alexandrst88 authored Jun 6, 2023
2 parents aa24534 + 1bcb043 commit cc965bc
Showing 1 changed file with 68 additions and 44 deletions.
112 changes: 68 additions & 44 deletions .github/workflows/deploy.chat.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,83 @@
name: Deploy from Chat
name: Deploy from tag

on:
deployment:
workflow_dispatch:
inputs:
environment:
description: "Environment to deploy."
required: true
type: choice
options:
- goerli
- mainnet


# Disable simultaneous deployments into a single environment
concurrency: deploy-chat-${{ github.event.deployment.environment }}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
setup:
name: Setup
uses: ./.github/workflows/setup.runtime.yml
with:
find-latest-config: true
environment: ${{ github.event.deployment.environment }}
environment: ${{ inputs.environment }}
secrets:
github-token: ${{ secrets.ZKSYNC_ADMIN_BOT_ORG_REPO_WRITE }}
echo-vars:
needs: Setup
runs-on: [self-hosted, default, infra]
name: "echo vars"
steps:
- run:
echo "cluster - ${{ needs.setup.outputs.cluster }}"
echo "config-tag -${{ needs.setup.outputs.config-tag }}"
echo "environment -${{ needs.setup.outputs.environment }}"
echo "release-namespace -${{ needs.setup.outputs.release-namespace }}"
echo "deployment- id -${{ github.event.deployment.id }}"
echo "sha-short -${{ needs.setup.outputs.sha-short }}"

update:
name: Update
uses: ./.github/workflows/server.update-config.yml
needs: [setup]
with:
ref: ${{ needs.setup.outputs.config-tag }}
cluster: ${{ needs.setup.outputs.cluster }}
environment: ${{ needs.setup.outputs.environment }}
namespace: ${{ needs.setup.outputs.release-namespace }}
secrets:
github-token: ${{ secrets.ZKSYNC_ADMIN_BOT_ORG_REPO_WRITE }}
# update:
# name: Update
# uses: ./.github/workflows/server.update-config.yml
# needs: [setup]
# with:
# ref: ${{ needs.setup.outputs.config-tag }}
# cluster: ${{ needs.setup.outputs.cluster }}
# environment: ${{ needs.setup.outputs.environment }}
# namespace: ${{ needs.setup.outputs.release-namespace }}
# secrets:
# github-token: ${{ secrets.ZKSYNC_ADMIN_BOT_ORG_REPO_WRITE }}

deploy:
name: Deploy
uses: ./.github/workflows/deploy.yml
needs: [setup, update]
with:
cluster: ${{ needs.setup.outputs.cluster }}
environment: ${{ needs.setup.outputs.environment }}
release-environment: ${{ needs.setup.outputs.release-environment }}
release-namespace: ${{ needs.setup.outputs.release-namespace }}
deployment-id: ${{ github.event.deployment.id }}
image-tag: ${{ needs.setup.outputs.sha-short }}
secrets:
github-token: ${{ secrets.ZKSYNC_ADMIN_BOT_ORG_REPO_WRITE }}
# deploy:
# name: Deploy
# uses: ./.github/workflows/deploy.yml
# needs: [setup, update]
# with:
# cluster: ${{ needs.setup.outputs.cluster }}
# environment: ${{ needs.setup.outputs.environment }}
# release-environment: ${{ needs.setup.outputs.release-environment }}
# release-namespace: ${{ needs.setup.outputs.release-namespace }}
# deployment-id: ${{ github.event.deployment.id }}
# image-tag: ${{ needs.setup.outputs.sha-short }}
# secrets:
# github-token: ${{ secrets.ZKSYNC_ADMIN_BOT_ORG_REPO_WRITE }}

notify:
runs-on: ubuntu-latest
needs: [deploy]
if: always() && !cancelled()
steps:
- uses: technote-space/workflow-conclusion-action@482bb0dbebad067b3b26ca4f6222c4023cf51ccf # v2
-
name: Notify to Mattermost (on incidents)
uses: tferreira/matterfy@releases/v1
if: ${{ env.WORKFLOW_CONCLUSION == 'failure' }}
with:
type: failure
job_name: '*Deploy to `${{ needs.setup.outputs.environment }}` failed*'
icon_emoji: octocat
channel: 'ci-notifications'
url: ${{ secrets.MATTERMOST_WEBHOOK }}
# notify:
# runs-on: ubuntu-latest
# needs: [deploy]
# if: always() && !cancelled()
# steps:
# - uses: technote-space/workflow-conclusion-action@482bb0dbebad067b3b26ca4f6222c4023cf51ccf # v2
# -
# name: Notify to Mattermost (on incidents)
# uses: tferreira/matterfy@releases/v1
# if: ${{ env.WORKFLOW_CONCLUSION == 'failure' }}
# with:
# type: failure
# job_name: '*Deploy to `${{ needs.setup.outputs.environment }}` failed*'
# icon_emoji: octocat
# channel: 'ci-notifications'
# url: ${{ secrets.MATTERMOST_WEBHOOK }}

0 comments on commit cc965bc

Please sign in to comment.