Skip to content

fix: fetch-depth 0 (#7264) #28

fix: fetch-depth 0 (#7264)

fix: fetch-depth 0 (#7264) #28

name: Deploy to devnet
on:
push:
branches: [devnet]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
GIT_COMMIT: ${{ github.sha }}
DEPLOY_TAG: devnet
FILE_PATH: ./l1-contracts/addresses.txt
# TF Vars
TF_VAR_DOCKERHUB_ACCOUNT: aztecprotocol
TF_VAR_CHAIN_ID: 31337
TF_VAR_BOOTNODE_1_PRIVATE_KEY: ${{ secrets.BOOTNODE_1_PRIVATE_KEY }}
TF_VAR_BOOTNODE_2_PRIVATE_KEY: ${{ secrets.BOOTNODE_2_PRIVATE_KEY }}
TF_VAR_SEQ_1_PUBLISHER_PRIVATE_KEY: ${{ secrets.SEQ_1_PUBLISHER_PRIVATE_KEY }}
TF_VAR_SEQ_2_PUBLISHER_PRIVATE_KEY: ${{ secrets.SEQ_2_PUBLISHER_PRIVATE_KEY }}
TF_VAR_DEPLOY_TAG: devnet
TF_VAR_API_KEY: ${{ secrets.FORK_API_KEY }}
jobs:
setup:
uses: ./.github/workflows/setup-runner.yml
with:
username: master
runner_type: builder-x86
secrets: inherit
build:
runs-on: ${{ github.actor }}-x86
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: build-release-artifacts-${{ github.actor }}
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
- name: "Build & Push images"
timeout-minutes: 40
# Run the build steps for each image with version and arch, push to dockerhub
run: |
earthly-ci --no-output --push ./yarn-project+export-aztec-arch --DIST_TAG=devnet
terraform_deploy:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
with:
ref: "${{ env.GIT_COMMIT }}"
fetch-depth: 0
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.7.5
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Check if L1 contracts need deployment
id: check_changes
uses: actions/github-script@v6
with:
script: |
const { execSync } = require('child_process');
const changedFiles = execSync('git diff --name-only ${{ github.event.before }} ${{ github.sha }}').toString().split('\n');
const fileChanged = changedFiles.includes('l1-contracts/REDEPLOY');
return { fileChanged };
- name: Deploy L1 Contracts
if: steps.check_changes.outputs.fileChanged == 'true'
run: |
earthly-ci --no-output ./yarn-project/cli+deploy-l1-contracts \
--PRIVATE_KEY=${{ secrets.SEQ_1_PUBLISHER_PRIVATE_KEY }} \
--RPC_URL=https://${{ env.DEPLOY_TAG }}-mainnet-fork.aztec.network:8545/${{ secrets.FORK_API_KEY }} \
| tee ${{ env.FILE_PATH }}
./scripts/extract_l1_addresses.sh ${{ env.FILE_PATH }}
- name: Apply l1-contracts Terraform
if: steps.check_changes.outputs.fileChanged == 'true'
working-directory: ./l1-contracts/terraform
run: |
terraform init -input=false -backend-config="key=devnet/l1-contracts"
terraform apply -input=false -auto-approve
- name: Deploy P2P Bootstrap Nodes
working-directory: ./yarn-project/p2p-bootstrap/terraform
run: |
terraform init -input=false -backend-config="key=devnet/p2p-bootstrap"
terraform apply -input=false -auto-approve
- name: Deploy Aztec Nodes
working-directory: ./yarn-project/aztec/terraform/node
run: |
terraform init -input=false -backend-config="key=devnet/aztec-node"
terraform apply -input=false -auto-approve
- name: Deploy Provers
working-directory: ./yarn-project/aztec/terraform/prover
run: |
terraform init -input=false -backend-config="key=devnet/prover"
terraform apply -input=false -auto-approve