Skip to content

Commit

Permalink
github/workflows: add deploy relay workflows (#2032)
Browse files Browse the repository at this point in the history
Relies on ObolNetwork/obol-infrastructure#538

Adds deployment of dev relay on merge, and a workflow to deploy two of our prod relays with a chosen tag/short sha

category: feature
ticket: #2031
  • Loading branch information
LukeHackett12 committed Apr 11, 2023
1 parent c968878 commit e53f3d3
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build-push-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@ jobs:
build-args: GITHUB_SHA=${{ github.sha }}
tags: ${{ steps.meta.outputs.tags }}

- name: Set short git commit SHA
id: vars
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "::set-output name=short_sha::$calculatedSha"
- name: Trigger dev relay deploy job
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.CHARON_K8S_REPO_ACCESS_TOKEN }}
repository: ObolNetwork/obol-infrastructure
event-type: relay-nonprod-deployment
client-payload: |
'{
"relay_name": "relay-dev",
"relay_version": "${{ steps.vars.outputs.short_sha }}"
}'
- name: Trigger charon-K8S deploy job
uses: peter-evans/repository-dispatch@v2
with:
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/deploy-relay-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'Deploy Dev Relay'

on:
workflow_dispatch:
inputs:
relay_name:
description: The docker image tag to deploy
required: true
type: choice
options:
- relay-dev
image_tag:
description: The docker image tag to deploy
required: true
type: string

jobs:
deploy-relay:
runs-on: ubuntu-latest
name: Build Docker Image
steps:
- name: Trigger relay nonprod deploy job
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.CHARON_K8S_REPO_ACCESS_TOKEN }}
repository: ObolNetwork/obol-infrastructure
event-type: relay-nonprod-deployment
client-payload: |
'{
"relay_name": "${{ github.relay_name }}",
"relay_version": "${{ github.image_tag }}"
}'
33 changes: 33 additions & 0 deletions .github/workflows/deploy-relay-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 'Deploy Prod Relay'

on:
workflow_dispatch:
inputs:
relay_name:
description: The docker image tag to deploy
required: true
type: choice
options:
- relay-0
- relay-1
image_tag:
description: The docker image tag to deploy
required: true
type: string

jobs:
deploy-relay:
runs-on: ubuntu-latest
name: Build Docker Image
steps:
- name: Trigger relay deploy job
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.CHARON_K8S_REPO_ACCESS_TOKEN }}
repository: ObolNetwork/obol-infrastructure
event-type: relay-prod-deployment
client-payload: |
'{
"relay_name": "${{ github.relay_name }}",
"relay_version": "${{ github.image_tag }}"
}'

0 comments on commit e53f3d3

Please sign in to comment.