Skip to content

Build and Deploy workflow #1

Build and Deploy workflow

Build and Deploy workflow #1

Workflow file for this run

name: Build and Deploy workflow
on:
pull_request:
types:
- closed
push:
branches:
- main
jobs:
build:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'CI:Build')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: e1018mc/limechain:go-ethereum-app
- name: Log out from DockerHub
run: docker logout
deploy-and-build:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'CI:Deploy')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: hardhat/Dockerfile
push: true
tags: e1018mc/limechain:smart_contract
- name: Run local devnet
run: docker-compose up -d
- name: Destroy local devnet
run: docker-compose down