mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
Create build.yml
This commit is contained in:
parent
d103f179b9
commit
e1574d8250
1 changed files with 52 additions and 0 deletions
52
.github/workflows/build.yml
vendored
Normal file
52
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
name: CI Build and Deploy
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- closed
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: contains(github.event.pull_request.labels.*.name, 'CI:Build')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
|
||||
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
docker build -t ipangelov/go-ethereum:latest .
|
||||
|
||||
- name: Push Docker image to Docker Hub
|
||||
run: |
|
||||
docker push ipangelov/go-ethereum:latest
|
||||
|
||||
deploy:
|
||||
if: contains(github.event.pull_request.labels.*.name, 'CI:Deploy')
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Start local devnet
|
||||
run: |
|
||||
docker-compose up -d
|
||||
|
||||
- name: Deploy Hardhat contracts
|
||||
run: |
|
||||
cd hardhat
|
||||
npx hardhat run scripts/deploy.js --network localhost
|
||||
|
||||
- name: Build & push pre-deployed contracts image
|
||||
run: |
|
||||
docker commit $(docker ps -q --filter ancestor=ipangelov/go-ethereum:latest) ipangelov/go-ethereum:contracts
|
||||
docker push ipangelov/go-ethereum:contracts
|
||||
|
||||
- name: Run Hardhat tests
|
||||
run: |
|
||||
cd hardhat
|
||||
npx hardhat test
|
||||
Loading…
Reference in a new issue