Deploy Cloud New #18
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: Deploy Cloud New | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| skip_ci: | |
| description: 'Skip CI and deploy directly' | |
| type: boolean | |
| required: false | |
| default: false | |
| push: | |
| branches: | |
| - master | |
| permissions: | |
| id-token: write | |
| contents: read | |
| env: | |
| ACTIONS_RUNNER_DEBUG: true | |
| ACTIONS_STEP_DEBUG: true | |
| concurrency: deploy-cloud-staging | |
| jobs: | |
| ci: | |
| uses: ./.github/workflows/ci.yml | |
| with: | |
| branchOrCommit: ${{ github.event.inputs.branchOrCommit || github.sha }} | |
| skipCI: ${{ github.event.inputs.skip_ci }} | |
| # ci-skipped: | |
| # if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.skip_ci == 'true' }} | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - run: echo "CI was skipped by user input" | |
| deploy-staging: | |
| needs: ci | |
| if: always() && (needs.ci.result == 'success' || needs.ci-skipped.result == 'success') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: | | |
| echo "Starting deploy staging..." | |
| sleep 35 # give you time to cancel manually | |
| echo "Finished deploy" | |
| check-staging: | |
| needs: deploy-staging | |
| if: needs.deploy-staging.result == 'success' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: echo "Check staging" | |
| cancel-stack: | |
| needs: deploy-staging | |
| if: cancelled() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: echo "Cancelling stack" |