From 649f654a69f94e070e2b56052113ab68cc38ab63 Mon Sep 17 00:00:00 2001 From: wanwiset25 Date: Wed, 27 Mar 2024 13:10:55 +0400 Subject: [PATCH] fix calling parameters --- .github/workflows/ci.yml | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54754e187b1b..2e924a0862c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,6 +80,8 @@ jobs: runs-on: ubuntu-latest if: github.ref == 'refs/heads/dev-upgrade' && !startsWith(github.ref, 'refs/tags/') needs: tests + outputs: + output1: ${{ steps.out.outputs.image_name }} steps: - uses: actions/checkout@v4 - name: Login to Docker Hub @@ -87,24 +89,19 @@ jobs: - name: Build and Push Docker images run: | git_hash=$(git rev-parse --short "$GITHUB_SHA") + image_name=xinfinorg/devnet:dev-upgrade-${git_hash} docker pull xinfinorg/devnet:latest docker tag xinfinorg/devnet:latest xinfinorg/devnet:previous docker rmi xinfinorg/devnet:latest docker build -t xinfinorg/devnet:latest -f cicd/Dockerfile . - docker tag xinfinorg/devnet:latest xinfinorg/devnet:dev-upgrade-${git_hash} - docker push xinfinorg/devnet:dev-upgrade-${git_hash} + docker tag xinfinorg/devnet:latest $image_name + docker push $image_name docker push xinfinorg/devnet:latest docker push xinfinorg/devnet:previous - - name: Update RPC nodes image - uses: dawidd6/action-ansible-playbook@v2 - with: - playbook: playbooks/update-image.yaml - directory: ./cicd/ansible - key: ${{secrets.SSH_PRIVATE_KEY_DEVNET}} - options: | - --inventory inventory.yaml - --extra-vars rpc_image=xinfinorg/devnet:dev-upgrade-${git_hash} + - name: Output image name + id: out + run: echo "image_name=$image_name" >> "$GITHUB_OUTPUT" devnet_terraform_apply: runs-on: ubuntu-latest @@ -152,6 +149,17 @@ jobs: terraform init ${{ env.tf_init_cli_options }} terraform apply ${{ env.tf_apply_cli_options }} + - name: Update RPC nodes image + uses: dawidd6/action-ansible-playbook@v2 + with: + playbook: playbooks/update-image.yaml + directory: ./cicd/ansible + key: ${{secrets.SSH_PRIVATE_KEY_DEVNET}} + options: | + --inventory inventory.yaml + --extra-vars network=ec2-rpcs + --extra-vars rpc_image=${{ needs.devnet_build_push.outputs.image_name }} + devnet_dev-upgrade_node: runs-on: ubuntu-latest if: github.ref == 'refs/heads/dev-upgrade' && !startsWith(github.ref, 'refs/tags/')