Skip to content

Commit

Permalink
fix calling parameters (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
wanwiset25 authored Mar 27, 2024
1 parent d12d616 commit 553c1d4
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,31 +80,28 @@ 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
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- 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
Expand Down Expand Up @@ -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/')
Expand Down

0 comments on commit 553c1d4

Please sign in to comment.