🐛 Show staking data (#5) #9
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 | |
| on: | |
| push: | |
| branches: [main] | |
| concurrency: | |
| group: deploy-${{ github.ref }} | |
| cancel-in-progress: false | |
| permissions: | |
| id-token: write | |
| contents: read | |
| env: | |
| AWS_REGION: ${{ vars.AWS_REGION }} | |
| ENVIRONMENT: prod | |
| TF_DIR: terraform | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: prod | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - uses: hashicorp/setup-terraform@v3 | |
| with: | |
| terraform_version: "~1.0" | |
| - uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: Install Poetry | |
| run: pip install poetry poetry-plugin-export | |
| - name: Build Lambda layer | |
| run: | | |
| mkdir -p build/lambda-layer/python | |
| poetry export -f requirements.txt --without-hashes -o build/requirements.txt | |
| pip install \ | |
| --target build/lambda-layer/python \ | |
| --platform manylinux2014_x86_64 \ | |
| --python-version 3.11 \ | |
| --only-binary=:all: \ | |
| -r build/requirements.txt | |
| cd build/lambda-layer | |
| zip -r ../python-deps.zip python/ > /dev/null | |
| - name: Upload Lambda layer to S3 | |
| run: | | |
| BUCKET="aztec-supply-lambda-artifacts-${ENVIRONMENT}" | |
| aws s3 cp build/python-deps.zip "s3://${BUCKET}/layers/python-deps.zip" | |
| - name: Terraform init | |
| working-directory: ${{ env.TF_DIR }} | |
| run: | | |
| terraform init \ | |
| -backend-config="bucket=aztec-foundation-terraform-state" \ | |
| -backend-config="key=circulating-supply-api" \ | |
| -backend-config="region=${AWS_REGION}" | |
| - name: Terraform plan | |
| working-directory: ${{ env.TF_DIR }} | |
| run: terraform plan -out=tfplan -input=false | |
| env: | |
| TF_VAR_eth_rpc_url: ${{ secrets.ETH_RPC_URL }} | |
| TF_VAR_route53_zone_id: ${{ secrets.ROUTE53_ZONE_ID }} | |
| TF_VAR_aws_region: ${{ env.AWS_REGION }} | |
| TF_VAR_environment: ${{ env.ENVIRONMENT }} | |
| - name: Terraform apply | |
| working-directory: ${{ env.TF_DIR }} | |
| run: terraform apply -input=false tfplan | |
| - name: Smoke test | |
| run: | | |
| sleep 5 | |
| STATUS=$(curl -s -o /dev/null -w "%{http_code}" https://supply.aztec.network/ || true) | |
| if [ "$STATUS" = "200" ]; then | |
| echo "API returned 200 OK" | |
| else | |
| echo "Warning: API returned $STATUS (may need time for DNS propagation)" | |
| fi | |