Refactor release workflow and update documentation#297
Merged
Conversation
- Revised the README to clarify the multi-tenant architecture and tiered infrastructure for LadybugDB. - Improved deployment workflows by adding checks for ACTIONS_TOKEN availability, enabling dispatch-based deployments for better monitoring. - Introduced reusable workflows as a fallback when ACTIONS_TOKEN is not set, ensuring consistent deployment processes across environments.
Comment on lines
+157
to
+178
| needs: create-tag | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| use_dispatch: ${{ steps.check.outputs.use_dispatch }} | ||
| steps: | ||
| - name: Check for ACTIONS_TOKEN | ||
| id: check | ||
| run: | | ||
| if [ "${{ secrets.ACTIONS_TOKEN != '' }}" = "true" ]; then | ||
| echo "use_dispatch=true" >> $GITHUB_OUTPUT | ||
| echo "✅ ACTIONS_TOKEN available - will dispatch independent workflow runs" | ||
| else | ||
| echo "use_dispatch=false" >> $GITHUB_OUTPUT | ||
| echo "ℹ️ ACTIONS_TOKEN not set - using reusable workflows (bundled in this run)" | ||
| fi | ||
|
|
||
| # ============================================================================ | ||
| # DISPATCH-BASED DEPLOYMENTS (when ACTIONS_TOKEN is available) | ||
| # Each deployment runs as an independent workflow for better monitoring | ||
| # ============================================================================ | ||
|
|
||
| deploy-staging-dispatch: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Comment on lines
+179
to
+214
| needs: [create-branch, create-tag, check-deploy-method] | ||
| if: | | ||
| needs.check-deploy-method.outputs.use_dispatch == 'true' && | ||
| (inputs.deploy_target == 'staging' || inputs.deploy_target == 'all') | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| outputs: | ||
| run_id: ${{ steps.dispatch.outputs.run_id }} | ||
| steps: | ||
| - name: Dispatch staging deployment | ||
| id: dispatch | ||
| env: | ||
| GH_TOKEN: ${{ secrets.ACTIONS_TOKEN }} | ||
| run: | | ||
| echo "🚀 Dispatching staging deployment from tag ${{ needs.create-tag.outputs.tag_name }}" | ||
|
|
||
| # Trigger the workflow | ||
| gh workflow run staging.yml \ | ||
| --repo ${{ github.repository }} \ | ||
| --ref ${{ needs.create-tag.outputs.tag_name }} | ||
|
|
||
| # Wait briefly for the run to be created | ||
| sleep 5 | ||
|
|
||
| # Get the run ID of the triggered workflow | ||
| RUN_ID=$(gh run list \ | ||
| --repo ${{ github.repository }} \ | ||
| --workflow=staging.yml \ | ||
| --limit 1 \ | ||
| --json databaseId \ | ||
| --jq '.[0].databaseId') | ||
|
|
||
| echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT | ||
| echo "✅ Staging deployment dispatched: https://github.com/${{ github.repository }}/actions/runs/$RUN_ID" | ||
|
|
||
| deploy-prod-dispatch: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Comment on lines
+215
to
+264
| needs: [create-branch, create-tag, check-deploy-method, deploy-staging-dispatch] | ||
| if: | | ||
| always() && | ||
| needs.check-deploy-method.outputs.use_dispatch == 'true' && | ||
| (inputs.deploy_target == 'prod' || inputs.deploy_target == 'all') && | ||
| (needs.deploy-staging-dispatch.result == 'success' || needs.deploy-staging-dispatch.result == 'skipped') | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| outputs: | ||
| run_id: ${{ steps.dispatch.outputs.run_id }} | ||
| steps: | ||
| - name: Wait before prod deployment | ||
| if: inputs.deploy_target == 'all' | ||
| run: | | ||
| echo "⏳ Waiting 30 seconds before dispatching prod deployment..." | ||
| echo " (prod.yml has concurrency group - will queue if staging still running)" | ||
| sleep 30 | ||
|
|
||
| - name: Dispatch prod deployment | ||
| id: dispatch | ||
| env: | ||
| GH_TOKEN: ${{ secrets.ACTIONS_TOKEN }} | ||
| run: | | ||
| echo "🚀 Dispatching prod deployment from tag ${{ needs.create-tag.outputs.tag_name }}" | ||
|
|
||
| # Trigger the workflow | ||
| gh workflow run prod.yml \ | ||
| --repo ${{ github.repository }} \ | ||
| --ref ${{ needs.create-tag.outputs.tag_name }} | ||
|
|
||
| # Wait briefly for the run to be created | ||
| sleep 5 | ||
|
|
||
| # Get the run ID of the triggered workflow | ||
| RUN_ID=$(gh run list \ | ||
| --repo ${{ github.repository }} \ | ||
| --workflow=prod.yml \ | ||
| --limit 1 \ | ||
| --json databaseId \ | ||
| --jq '.[0].databaseId') | ||
|
|
||
| echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT | ||
| echo "✅ Prod deployment dispatched: https://github.com/${{ github.repository }}/actions/runs/$RUN_ID" | ||
|
|
||
| # ============================================================================ | ||
| # REUSABLE WORKFLOW DEPLOYMENTS (fallback when ACTIONS_TOKEN not available) | ||
| # Deployments run as part of this workflow - less visibility but no PAT needed | ||
| # ============================================================================ | ||
|
|
||
| deploy-staging-reusable: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR enhances the release deployment workflow and updates the project documentation to reflect recent infrastructure improvements.
Key Accomplishments
Changes Made
.github/workflows/create-release.ymlwith substantial enhancements (~167 net lines added)Breaking Changes
None identified - this is primarily a workflow and documentation enhancement.
Testing Notes
Infrastructure Considerations
🤖 Generated with Claude Code
Branch Info:
refactor/create-release-flowmainCo-Authored-By: Claude noreply@anthropic.com