Merge pull request #950 from flashcatcloud/feat/alert-batch22-test2 #192
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: Upload integration docs to OSS | |
| env: | |
| CDN_URL: 'https://docs-cdn.flashcat.cloud' | |
| on: | |
| push: | |
| branches: [main, test] | |
| paths: | |
| - 'integration-docs/**' | |
| - 'zh/on-call/integration/**' | |
| - 'en/on-call/integration/**' | |
| - 'zh/on-call/configuration/templates.mdx' | |
| - 'en/on-call/configuration/templates.mdx' | |
| - '.github/workflows/integration-docs-upload.yml' | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| description: 'Target environment' | |
| required: true | |
| default: 'development' | |
| type: choice | |
| options: | |
| - development | |
| - production | |
| # Runs for one branch upload the same zh.js/en.js objects. Run them one at a time so an | |
| # older run that finishes late cannot overwrite the files of a newer one. | |
| concurrency: | |
| group: integration-docs-upload-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| build-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Build compatibility bundle | |
| working-directory: integration-docs | |
| run: npm run build | |
| - name: Check compatibility bundle | |
| working-directory: integration-docs | |
| run: npm run check | |
| - name: Test upload URL construction | |
| working-directory: integration-docs | |
| run: npm run test:upload-url | |
| upload-development: | |
| needs: build-check | |
| if: github.ref == 'refs/heads/test' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'development') | |
| runs-on: ubuntu-latest | |
| environment: development | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Install dependencies | |
| working-directory: integration-docs | |
| run: npm install | |
| - name: Upload development integration docs | |
| working-directory: integration-docs | |
| env: | |
| CDN_ACCESS_KEY: ${{ secrets.CDN_ACCESS_KEY }} | |
| CDN_SECRET_KEY: ${{ secrets.CDN_SECRET_KEY }} | |
| CDN_BUCKET: ${{ secrets.CDN_BUCKET }} | |
| CDN_REGION: ${{ secrets.CDN_REGION }} | |
| CDN_ENDPOINT: ${{ secrets.CDN_ENDPOINT }} | |
| CDN_DIR: '/test/docs' | |
| run: npm run upload | |
| upload-production: | |
| needs: build-check | |
| if: github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'production') | |
| runs-on: ubuntu-latest | |
| environment: production | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Install dependencies | |
| working-directory: integration-docs | |
| run: npm install | |
| - name: Upload production integration docs | |
| working-directory: integration-docs | |
| env: | |
| CDN_ACCESS_KEY: ${{ secrets.CDN_ACCESS_KEY }} | |
| CDN_SECRET_KEY: ${{ secrets.CDN_SECRET_KEY }} | |
| CDN_BUCKET: ${{ secrets.CDN_BUCKET }} | |
| CDN_REGION: ${{ secrets.CDN_REGION }} | |
| CDN_ENDPOINT: ${{ secrets.CDN_ENDPOINT }} | |
| CDN_DIR: '/docs' | |
| run: npm run upload |