Deployment Staging #358
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: Deployment Staging | |
| # Staging follows `develop` under the same rule as production follows `master`: | |
| # deploy the commit whose pipeline passed, not merely the latest commit. See | |
| # deploy_production.yml for why `workflow_run` rather than `push`, and why the | |
| # head_sha has to be passed explicitly. | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| ref: | |
| description: "Commit or branch to deploy" | |
| required: false | |
| default: develop | |
| type: string | |
| workflow_run: | |
| workflows: ["Main pipeline: build, lint, test"] | |
| branches: ["develop"] | |
| types: [completed] | |
| jobs: | |
| deploy-staging: | |
| if: >- | |
| github.event_name == 'workflow_dispatch' || | |
| github.event.workflow_run.conclusion == 'success' | |
| uses: "./.github/workflows/deployment.yml" | |
| with: | |
| environment: staging | |
| remote_host: staging.atomicdata.dev | |
| ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.event.workflow_run.head_sha }} | |
| secrets: inherit |