@@ -125,16 +125,16 @@ jobs:
125125 name : Open devnet deploy PR
126126 needs : build-and-push
127127 runs-on : ubuntu-latest
128- if : startsWith(github.ref, 'refs/tags/v') || startsWith(inputs.tag, 'v')
128+ # Devnet continuously tracks main: deploy the main-<sha> image on every
129+ # direct push to main. Release builds (workflow_call with a version tag)
130+ # and manual dispatches build images only — mainnet promotion is manual.
131+ if : github.event_name == 'push' && github.ref == 'refs/heads/main' && inputs.tag == ''
129132 steps :
130- - name : Compute version
133+ - name : Compute image tag
131134 id : version
132- env :
133- REF : ${{ github.ref_name }}
134- INPUT : ${{ inputs.tag }}
135135 run : |
136- VERSION="${INPUT:-$REF}"
137- [[ "$ VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]] || { echo "Invalid version: $VERSION"; exit 1; }
136+ # Must match the main-<sha> tag produced by docker/metadata-action above
137+ VERSION="main-${GITHUB_SHA::7}"
138138 echo "version=$VERSION" >> $GITHUB_OUTPUT
139139
140140 - name : Checkout infra-kubernetes
@@ -157,9 +157,11 @@ jobs:
157157 GH_TOKEN : ${{ secrets.INFRA_GH_TOKEN }}
158158 FILE_PATH : definitions/canton/validator-dev1/canton-middleware-api-values.yml
159159 REPO : ChainSafe/infra-kubernetes
160+ SOURCE_REPO : ${{ github.repository }}
161+ SOURCE_SHA : ${{ github.sha }}
160162 run : |
161- BRANCH="chore/bump -canton-middleware-api-${VERSION}"
162- COMMIT_MSG="chore: bump canton-middleware-api to ${VERSION} on devnet "
163+ BRANCH="cd/devnet -canton-middleware-api-${VERSION}"
164+ COMMIT_MSG="chore(devnet): deploy canton-middleware-api ${VERSION}"
163165
164166 # Get current HEAD SHA of main
165167 HEAD_SHA=$(gh api repos/${REPO}/git/ref/heads/main --jq '.object.sha')
@@ -207,10 +209,18 @@ jobs:
207209 -f contents="${FILE_CONTENTS}"
208210
209211 # Open PR and enable auto-merge
212+ PR_BODY=$(cat <<EOF
213+ Automated continuous deployment to \`validator-dev1\`.
214+
215+ Bumps \`canton-middleware-api\` image tag to \`${VERSION}\`.
216+
217+ Source: [${SOURCE_REPO}@${SOURCE_SHA:0:7}](https://github.com/${SOURCE_REPO}/commit/${SOURCE_SHA})
218+ EOF
219+ )
210220 gh pr create \
211221 --repo "${REPO}" \
212222 --title "${COMMIT_MSG}" \
213- --body "Automated PR: bump \`canton-middleware-api\` image tag to \`${VERSION}\` on \`validator-dev1\`. " \
223+ --body "${PR_BODY} " \
214224 --base main \
215225 --head "${BRANCH}" \
216226 || { echo "PR already exists for this branch, skipping"; exit 0; }
0 commit comments