Skip to content

Merge pull request #95 from Jemiiah/feature/four-issues #37

Merge pull request #95 from Jemiiah/feature/four-issues

Merge pull request #95 from Jemiiah/feature/four-issues #37

Workflow file for this run

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

View workflow run for this annotation

GitHub Actions / CD

Invalid workflow file

The workflow is not valid. .github/workflows/cd.yml (Line: 23, Col: 3): Error calling workflow 'MetroLogic/fluxapay_contract/.github/workflows/deploy.yml@683f60f3c06886057aadfcee3488e6b1cda81416'. The nested job 'deploy' is requesting 'contents: write', but is only allowed 'contents: read'.
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