diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7c92c0fe4e..2cb06ca8de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -103,11 +103,18 @@ jobs: trufflesuite/ganache ghcr.io/${{ github.repository}} + - name: Set TAG and VERSION + run: | + echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV + echo "VERSION=$(node -e 'console.log(require("./src/packages/ganache/package.json").version)')" >> $GITHUB_ENV + - name: Build and push Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: context: . file: ./src/packages/ganache/Dockerfile push: true - tags: ${{ steps.meta.outputs.tags }} + tags: ${{ format('trufflesuite/ganache:{0}, trufflesuite/ganache:v{1}', env.TAG, env.VERSION) }} labels: ${{ steps.meta.outputs.labels }} + build-args: | + INFURA_KEY=${{ secrets.INFURA_KEY }} diff --git a/package.json b/package.json index 2310552c95..3180cc0ba6 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "postinstall": "ts-node scripts/postinstall", "reinstall": "npm run clean && npm install", "prepublishOnly": "ts-node ./scripts/filter-shrinkwrap.ts \"$(lerna list --parseable --scope ganache)\"/npm-shrinkwrap.json", + "postpublish": "git restore \"$(lerna list --parseable --scope ganache)\"/npm-shrinkwrap.json", "start": "lerna exec --loglevel=silent --scope ganache -- npm run start --silent -- ", "test": "lerna exec --concurrency 1 -- npm run test", "tsc": "ttsc --build src", diff --git a/src/packages/ganache/Dockerfile b/src/packages/ganache/Dockerfile index 916797a9c8..70645d6f20 100644 --- a/src/packages/ganache/Dockerfile +++ b/src/packages/ganache/Dockerfile @@ -9,6 +9,9 @@ COPY . . RUN npm run clean RUN npm ci --unsafe-perm +# import INFURA_KEY environment variable (build-arg) +ARG INFURA_KEY + # build application RUN npm run build