go-ethereum/.github/workflows/ci_deploy.yaml
2024-06-15 21:21:42 +03:00

59 lines
1.5 KiB
YAML

name: Deploy Contracts to Devnet
on:
pull_request:
types:
- closed
push:
branches:
- main
jobs:
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@v1
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Set up Node.js
# uses: actions/setup-node@v4
# with:
# node-version: '20'
# - name: Install dependencies
# run: npm install --save-dev hardhat
- name: Run local devnet
run: docker-compose up -d
- name: Build a new image with Apollo contract
run: docker build -t hardhat-ignition .
# - name: Deploy contracts
# run: |
# cd /home/runner/work/go-ethereum/go-ethereum/hardhat
# npm install --save-dev @nomicfoundation/hardhat-toolbox
# npx hardhat ignition deploy ./ignition/modules/Lock.js
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: e1018mc/limechain:apollo_contract
- name: Destroy local devnet
run: docker-compose down