Skip to content

Commit

Permalink
Remade wfs to deploy to all clusters.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinnie161 committed Nov 21, 2024
1 parent 500c903 commit 723a84b
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 42 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/build_production.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Build and release devel image
name: Build and deploy devel image

on:
push:
Expand All @@ -12,7 +12,7 @@ env:

jobs:
build-and-push:
name: Build and push image
name: Build and push devel image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
Expand Down Expand Up @@ -40,15 +40,14 @@ jobs:
needs:
- build-and-push
runs-on: ubuntu-latest
name: Deploy devel
name: Deploy devel image
steps:
- name: Deploy devel image
- name: Deploy to development cluster
uses: lidofinance/dispatch-workflow@v1
env:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
TARGET_REPO: 'lidofinance/ansible-onchain-mon-infra'
# TAG: '${{ github.event.release.tag_name }}'
TARGET: devel
DISPATCH_BRANCH: main
TARGET_WORKFLOW: 'onchain_mon_devel_deploy.yaml'
62 changes: 62 additions & 0 deletions .github/workflows/production_build_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
name: Build and deploy production image

on:
push:
branches:
- main

env:
IMAGE_NAME: onchain-mon
IMAGE_TAG: stable

jobs:
build-and-push:
name: Build and push stable image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Setup buildx
id: buildx
uses: docker/[email protected]

- name: Log in to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build docker image
id: docker_build_candidate
uses: docker/[email protected]
with:
push: true
tags: lidofinance/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
builder: ${{ steps.buildx.outputs.name }}

deploy:
needs:
- build-and-push
runs-on: ubuntu-latest
name: Deploy stable image
steps:
- name: Deploy to production cluster1
uses: lidofinance/dispatch-workflow@v1
env:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
TARGET_REPO: 'lidofinance/ansible-onchain-mon-infra'
TARGET: main
DISPATCH_BRANCH: main
TARGET_WORKFLOW: 'onchain_mon_prod1_deploy.yaml'
- name: Deploy to production cluster2
uses: lidofinance/dispatch-workflow@v1
env:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
TARGET_REPO: 'lidofinance/ansible-onchain-mon-infra'
TARGET: main
DISPATCH_BRANCH: main
TARGET_WORKFLOW: 'onchain_mon_prod2_deploy.yaml'

0 comments on commit 723a84b

Please sign in to comment.