🕶️ Deploy Using ECS #6
Workflow file for this run
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 Using ECS | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| description: Environment to deploy | |
| required: true | |
| default: staging | |
| type: environment | |
| acr-region: | |
| description: ACR registry | |
| type: choice | |
| default: cn-shenzhen | |
| options: | |
| - cn-shenzhen | |
| - us-east-1 | |
| instance-size: | |
| description: ECS instance size | |
| type: string | |
| default: 32c64g | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| push: | |
| runs-on: ubuntu-latest | |
| environment: ${{ github.event.inputs.environment }} | |
| env: | |
| CR: univer-acr-registry.cn-shenzhen.cr.aliyuncs.com | |
| steps: | |
| - name: Set IMAGE_TAG environment variable | |
| run: echo "IMAGE_TAG=$(echo ${{ github.sha }} | cut -c 1-7)" >> $GITHUB_ENV | |
| - name: Set FEATURE environment variable | |
| if: ${{ startsWith(github.event_name == 'schedule' && 'staging' || inputs.environment, 'feature') }} | |
| run: echo "FEATURE=$(echo "${GITHUB_REF#refs/heads/feat/}")" >> "$GITHUB_ENV" | |
| - name: Set US ACR region | |
| if: ${{ inputs.acr-region == 'us-east-1' || inputs.environment == 'prod' || inputs.environment == 'feature prod' }} | |
| run: | | |
| echo "CR=univer-acr-eastus-registry.us-east-1.cr.aliyuncs.com" >> "$GITHUB_ENV" | |
| - uses: peter-evans/repository-dispatch@v4 | |
| with: | |
| token: ${{ secrets.GH_TOKEN }} | |
| repository: dream-num/runner-machine | |
| event-type: create-ci | |
| client-payload: > | |
| { | |
| "service": "documentation", | |
| "git_ref": "${{ github.ref }}", | |
| "image_tag": "${{ env.IMAGE_TAG }}", | |
| "cr": "${{ env.CR }}", | |
| "next_public_docs_source_ref": "${{ github.ref_name }}", | |
| "next_posthog_apikey": "${{ secrets.NEXT_POSTHOG_APIKEY }}", | |
| "machine": { | |
| "instance_size": "${{ inputs.instance-size }}", | |
| "region":"us-virginia", | |
| "internet_bandwidth": "100" | |
| }, | |
| "helm_dispatch": { | |
| "event": "${{ vars.DISPATCH_EVENT_TYPE }}", | |
| "service": "univer-docs-site", | |
| "feature": "${{ env.FEATURE }}" | |
| } | |
| } |