Merge pull request #95 from Jemiiah/feature/four-issues #37
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
| name: CD | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
| inputs: | ||
| target-environment: | ||
| description: "Deployment environment" | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - development | ||
| - staging | ||
| - production | ||
| permissions: | ||
| contents: read | ||
| deployments: write | ||
| jobs: | ||
| # Deploy to development environment (automatic on main push) | ||
| deploy-dev: | ||
|
Check failure on line 23 in .github/workflows/cd.yml
|
||
| if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.target-environment == 'development') | ||
| uses: ./.github/workflows/deploy.yml | ||
| with: | ||
| environment_name: "development" | ||
| stellar_network: "testnet" | ||
| retention_days: 30 | ||
| secrets: inherit | ||
| # Deploy to staging environment (automatic on main push, after dev) | ||
| deploy-staging: | ||
| needs: [deploy-dev] | ||
| # Run if on main push (after dev) OR if manually triggered for staging | ||
| if: | | ||
| always() && | ||
| ((github.event_name == 'push' && needs.deploy-dev.result == 'success') || | ||
| (github.event_name == 'workflow_dispatch' && github.event.inputs.target-environment == 'staging')) | ||
| uses: ./.github/workflows/deploy.yml | ||
| with: | ||
| environment_name: "staging" | ||
| stellar_network: "testnet" | ||
| retention_days: 90 | ||
| secrets: inherit | ||
| # Deploy to production (manual trigger only) | ||
| deploy-production: | ||
| if: github.event_name == 'workflow_dispatch' && github.event.inputs.target-environment == 'production' | ||
| needs: [deploy-staging] | ||
| uses: ./.github/workflows/deploy.yml | ||
| with: | ||
| environment_name: "production" | ||
| stellar_network: "mainnet" | ||
| retention_days: 365 | ||
| is_production: true | ||
| secrets: inherit | ||