Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix calling parameters #506

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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