diff --git a/.github/workflows/nightly-masternet-deploy.yml b/.github/workflows/nightly-masternet-deploy.yml index 13e40b8bc519..59923ad3bbb9 100644 --- a/.github/workflows/nightly-masternet-deploy.yml +++ b/.github/workflows/nightly-masternet-deploy.yml @@ -2,8 +2,8 @@ name: Nightly masternet deploy on: schedule: - # Run the workflow every night at 2:00 AM UTC. - - cron: "0 2 * * *" + # Run the workflow every night at 4:00 AM UTC. After the nightly tag has been created + - cron: "0 4 * * *" workflow_dispatch: concurrency: @@ -11,37 +11,40 @@ concurrency: cancel-in-progress: false jobs: - get-latest-commit: + get-latest-tag: runs-on: ubuntu-latest outputs: - commit: ${{ steps.get_commit.outputs.COMMIT }} + tag: ${{ steps.get_tag.outputs.TAG }} steps: - uses: actions/checkout@v4 - - name: Get latest published commit - id: get_commit + - name: Get latest nightly tag + id: get_tag run: | - COMMIT=$(git rev-parse HEAD) - TAGS=$(curl -s https://registry.hub.docker.com/v2/repositories/aztecprotocol/aztec/tags/$COMMIT-amd64) + # Check if tonight's tag has been published to docker hub + current_version=$(jq -r '."."' .release-please-manifest.json) + echo "Current version: $current_version" + # Format the tag as: -nightly. + nightly_tag="${current_version}-nightly.$(date -u +%Y%m%d)" + + TAGS=$(curl -s https://registry.hub.docker.com/v2/repositories/aztecprotocol/aztec/tags/$nightly_tag) if [[ "$TAGS" != *"not found"* ]]; then - DIGEST=$(echo $TAGS | jq -r '.images[] | select(.architecture=="amd64") | .digest' | tr -d '"') - echo "Deploying digest: $DIGEST" - echo "COMMIT=$DIGEST" >> $GITHUB_OUTPUT + echo "TAG=$nightly_tag >> $GITHUB_OUTPUT else - echo "Commit $COMMIT not published to docker hub" + echo "Tag $nightly_tag not published to docker hub" exit 1 fi deploy-network: - needs: get-latest-commit + needs: get-latest-tag uses: ./.github/workflows/network-deploy.yml with: ref: master cluster: aztec-gke-private namespace: master-rc-1 values_file: rc-1.yaml - aztec_docker_image: aztecprotocol/aztec@${{ needs.get-latest-commit.outputs.commit }} + aztec_docker_image: aztecprotocol/aztec:${{ needs.get-latest-tag.outputs.tag }} deployment_mnemonic_secret_name: junk-mnemonic respect_tf_lock: "false" run_terraform_destroy: "true"