mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
54 lines
1.2 KiB
YAML
54 lines
1.2 KiB
YAML
name: Deploy and Test Hardhat Project
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
types:
|
|
- labeled
|
|
|
|
jobs:
|
|
deploy:
|
|
if: github.event.label.name == 'CI:Deploy'
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
password: ${{ secrets.DOCKER_HUB_PAT }}
|
|
|
|
- name: Install Docker Compose
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y docker-compose
|
|
|
|
- name: Export Environment Variable
|
|
run: echo "DOCKER_HUB_USERNAME=${{ secrets.DOCKER_HUB_USERNAME }}" >> $GITHUB_ENV
|
|
|
|
- name: Set up Docker Compose
|
|
run: |
|
|
docker-compose up --build -d
|
|
sleep 10
|
|
|
|
- name: Deploy Hardhat Contracts
|
|
run: |
|
|
cd hardhat
|
|
npm install
|
|
npx hardhat compile # Added the compile step
|
|
npx hardhat run scripts/deploy.js
|
|
|
|
- name: Run Hardhat Tests
|
|
run: |
|
|
cd hardhat
|
|
npx hardhat test
|
|
|
|
- name: Shutdown Docker Compose
|
|
run: docker-compose down
|