feat: add upgradeable EIL contracts and XLP funding scripts #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy to Testnet | |
| on: | |
| push: | |
| branches: [develop] | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| packages: write | |
| env: | |
| AWS_REGION: us-east-1 | |
| NETWORK: testnet | |
| jobs: | |
| validate: | |
| name: Validate | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v1 | |
| - uses: hashicorp/setup-terraform@v3 | |
| with: | |
| terraform_version: 1.6.0 | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Validate configurations | |
| run: bun run infra:validate | |
| build-images: | |
| name: Build Images | |
| runs-on: ubuntu-latest | |
| needs: validate | |
| strategy: | |
| matrix: | |
| app: [bazaar, gateway, leaderboard, documentation, indexer, compute, monitoring, storage] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ROLE_ARN_TESTNET }} | |
| aws-region: ${{ env.AWS_REGION }} | |
| - uses: aws-actions/amazon-ecr-login@v2 | |
| id: login-ecr | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Build and push ${{ matrix.app }} | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./apps/${{ matrix.app }} | |
| file: ./apps/${{ matrix.app }}/Dockerfile | |
| push: true | |
| tags: | | |
| ${{ steps.login-ecr.outputs.registry }}/jeju/${{ matrix.app }}:testnet-${{ github.sha }} | |
| ${{ steps.login-ecr.outputs.registry }}/jeju/${{ matrix.app }}:testnet-latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| platforms: linux/amd64 | |
| deploy-infrastructure: | |
| name: Deploy Infrastructure | |
| runs-on: ubuntu-latest | |
| needs: validate | |
| environment: testnet-infrastructure | |
| outputs: | |
| eks-cluster: ${{ steps.output.outputs.eks_cluster_name }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v1 | |
| - uses: hashicorp/setup-terraform@v3 | |
| with: | |
| terraform_version: 1.6.0 | |
| - uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ROLE_ARN_TESTNET }} | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Terraform Apply | |
| run: | | |
| cd packages/deployment | |
| NETWORK=testnet bun run infra:plan | |
| NETWORK=testnet bun run infra:apply | |
| - name: Get outputs | |
| id: output | |
| run: | | |
| cd packages/deployment/terraform/environments/testnet | |
| echo "eks_cluster_name=$(terraform output -raw eks_cluster_name)" >> $GITHUB_OUTPUT | |
| deploy-kubernetes: | |
| name: Deploy to Kubernetes | |
| runs-on: ubuntu-latest | |
| needs: [build-images, deploy-infrastructure] | |
| environment: testnet | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v1 | |
| - uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ROLE_ARN_TESTNET }} | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Configure kubectl | |
| run: | | |
| aws eks update-kubeconfig \ | |
| --name ${{ needs.deploy-infrastructure.outputs.eks-cluster }} \ | |
| --region ${{ env.AWS_REGION }} | |
| - name: Install Helmfile | |
| run: | | |
| wget -q https://github.com/helmfile/helmfile/releases/download/v0.162.0/helmfile_0.162.0_linux_amd64.tar.gz | |
| tar -xzf helmfile_0.162.0_linux_amd64.tar.gz | |
| sudo mv helmfile /usr/local/bin/ | |
| - name: Deploy with Helmfile | |
| run: | | |
| cd packages/deployment | |
| NETWORK=testnet bun run k8s:deploy | |
| - name: Wait for rollout | |
| run: | | |
| kubectl rollout status deployment/bazaar -n jeju-apps --timeout=10m | |
| kubectl rollout status deployment/gateway -n jeju-apps --timeout=10m | |
| verify: | |
| name: Verify Deployment | |
| runs-on: ubuntu-latest | |
| needs: deploy-kubernetes | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v1 | |
| - uses: foundry-rs/foundry-toolchain@v1 | |
| - name: Health checks | |
| run: | | |
| cast block latest --rpc-url https://testnet-rpc.jeju.network | |
| echo "✅ Testnet RPC responding" |