From f55a97701e106e7a307856c20dfa81d27c331ae9 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Mon, 9 Dec 2024 22:17:00 +0100 Subject: [PATCH] ci: move publish release docker image to GHA --- .github/workflows/integration-tests.yml | 27 ------------------- .github/workflows/release.yaml | 35 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 7280d376c..afec080eb 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -21,37 +21,10 @@ env: GHA_CLUSTER_SERVER_ADDR: "https://kubernetes.default:443" jobs: - # build_image: - # name: Build image - # runs-on: ubuntu-latest - # timeout-minutes: 30 - # steps: - # - name: Check out the repo - # uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v.4.2.0 - - # - name: npm build - # run: | - # cd javascript - # npm install - # npm dedupe - # npm run clean - # npm run build - - # - name: Build Docker image - # uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 - # with: - # file: ./scripts/ci/docker/zombienet_injected.Dockerfile - # context: . - # push: false - # tags: | - # ${{ env.IMAGE_NAME }}:${{ env.VERSION }} - # ${{ env.IMAGE_NAME }}:latest - build_push_image: name: Build and Push Docker image to Docker Hub runs-on: ubuntu-latest timeout-minutes: 30 - # needs: [build_image] steps: - name: Check out the repo uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v.4.2.0 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2bdee67f7..9a92b48d7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -105,3 +105,38 @@ jobs: asset_path: ./javascript/bins/zombienet-macos-${{ matrix.target.arch }} asset_name: zombienet-macos-${{ matrix.target.arch }} asset_content_type: application/octet-stream + build_push_image: + name: Build and Push Docker image to Docker Hub + runs-on: ubuntu-latest + timeout-minutes: 30 + environment: tags + env: + IMAGE_NAME: paritytech/zombienet + VERSION: ${{ github.ref_name }} + steps: + - name: Check out the repo + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v.4.2.0 + + - name: npm build + run: | + cd javascript + npm install + npm dedupe + npm run clean + npm run build + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_PASS }} + + - name: Build Docker image + uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 + with: + file: ./scripts/ci/docker/zombienet_injected.Dockerfile + context: . + push: true + tags: | + ${{ env.IMAGE_NAME }}:${{ env.VERSION }} + ${{ env.IMAGE_NAME }}:latest