Skip to content

Merge branch 'codex/upload-openapi-json-oss' into test #18

Merge branch 'codex/upload-openapi-json-oss' into test

Merge branch 'codex/upload-openapi-json-oss' into test #18

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'
workflow_dispatch:
inputs:
environment:
description: 'Target environment'
required: true
default: 'development'
type: choice
options:
- development
- production
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
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