mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
54 lines
1.3 KiB
YAML
54 lines
1.3 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@v3
|
|
|
|
- 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@v3
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- name: Run local devnet
|
|
run: |
|
|
docker-compose up -d
|
|
|
|
- name: Deploy contracts
|
|
run: npx hardhat run scripts/deploy.js --network localhost
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: e1018mc/limechain:deployed
|
|
# tags: your-docker-username/your-image-name:deployed
|
|
|
|
- name: Tear down local devnet
|
|
run: |
|
|
docker-compose down
|