Skip to content
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
31 changes: 17 additions & 14 deletions .github/workflows/nightly-masternet-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,49 @@
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:
group: ${{ github.workflow }}-${{ github.ref }}
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: <current_version>-nightly.<YYYYMMDD>
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"
Expand Down