From e7a6324178c1a86e637b7d366b01b0d099b1567a Mon Sep 17 00:00:00 2001 From: Nick Volynkin Date: Wed, 19 Jul 2023 10:51:48 +0300 Subject: [PATCH] docker: publish a reusable image --- .dockerignore | 17 +++++++++++++++++ .github/workflows/run_tests_docker.yml | 23 +++++++++++++++++++++++ Dockerfile | 8 ++++++++ 3 files changed, 48 insertions(+) create mode 100644 .dockerignore create mode 100644 .github/workflows/run_tests_docker.yml create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e35ebad --- /dev/null +++ b/.dockerignore @@ -0,0 +1,17 @@ +# Things we don't want in a Docker image +.env +.git +.github +.idea + +# build artifacts +coverage +coverage.json +node_modules +typechain +typechain-types + +# Hardhat files +artifacts +cache +deployments diff --git a/.github/workflows/run_tests_docker.yml b/.github/workflows/run_tests_docker.yml new file mode 100644 index 0000000..9c01e12 --- /dev/null +++ b/.github/workflows/run_tests_docker.yml @@ -0,0 +1,23 @@ +name: run-docker-tests + +on: + pull_request: + +concurrency: + group: ${{ + ( github.ref == 'refs/heads/master' && + format('{0}/{1}', github.run_id, github.run_attempt) ) + || + format('{0}/{1}', github.workflow, github.ref) }} + cancel-in-progress: true + + +jobs: + run-tests: + runs-on: [ ubuntu-22.04 ] + steps: + - uses: actions/checkout@v3 + + - name: Build a Docker image + run: docker build -t ghcr.io/nilfoundation/evm-placeholder-verifier:${{ github.sha }} . + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..073505d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM node:18.18-bullseye + +ADD . /opt/evm-placeholder-verification + +WORKDIR /opt/evm-placeholder-verification + +RUN npm install +RUN npx hardhat compile