99 type : string
1010
1111permissions :
12- contents : write # Required for `gh release create` in the "Create GitHub release" step.
12+ contents : read
1313
1414env :
1515 # Override these by editing this file or by setting the matching repository variable.
@@ -383,25 +383,6 @@ jobs:
383383 fi
384384 done
385385
386- - name : Create GitHub release
387- if : success() && steps.health-check.outputs.healthy == 'true'
388- env :
389- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
390- GITHUB_RUN_ID : ${{ github.run_id }}
391- STAGING_APP_NAME : ${{ vars.STAGING_APP_NAME }}
392- PRODUCTION_APP_NAME : ${{ vars.PRODUCTION_APP_NAME }}
393- shell : bash
394- run : |
395- set -euo pipefail
396-
397- release_date="$(date '+%Y-%m-%d')"
398- timestamp="$(date '+%H%M%S')"
399- release_tag="production-${release_date}-${timestamp}-${GITHUB_RUN_ID}"
400-
401- gh release create "${release_tag}" \
402- --title "Production Release ${release_date} ${timestamp}" \
403- --notes "Promoted ${STAGING_APP_NAME} to ${PRODUCTION_APP_NAME} on ${release_date} at ${timestamp}."
404-
405386 - name : Promotion summary
406387 if : always()
407388 env :
@@ -422,3 +403,31 @@ jobs:
422403 echo "Previous image (first container of selected/first workload): \`${PREVIOUS_IMAGE}\`"
423404 echo "Previous version: ${PREVIOUS_VERSION}"
424405 } >> "$GITHUB_STEP_SUMMARY"
406+
407+ create-release :
408+ needs : promote-to-production
409+ if : needs.promote-to-production.result == 'success'
410+ runs-on : ubuntu-latest
411+ timeout-minutes : 5
412+ permissions :
413+ contents : write
414+
415+ steps :
416+ - name : Create GitHub release
417+ env :
418+ GH_REPO : ${{ github.repository }}
419+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
420+ GITHUB_RUN_ID : ${{ github.run_id }}
421+ STAGING_APP_NAME : ${{ vars.STAGING_APP_NAME }}
422+ PRODUCTION_APP_NAME : ${{ vars.PRODUCTION_APP_NAME }}
423+ shell : bash
424+ run : |
425+ set -euo pipefail
426+
427+ release_date="$(date '+%Y-%m-%d')"
428+ timestamp="$(date '+%H%M%S')"
429+ release_tag="production-${release_date}-${timestamp}-${GITHUB_RUN_ID}"
430+
431+ gh release create "${release_tag}" \
432+ --title "Production Release ${release_date} ${timestamp}" \
433+ --notes "Promoted ${STAGING_APP_NAME} to ${PRODUCTION_APP_NAME} on ${release_date} at ${timestamp}."
0 commit comments