Skip to content

Merge pull request #47 from lidofinance/devel #1

Merge pull request #47 from lidofinance/devel

Merge pull request #47 from lidofinance/devel #1

---
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'