[Docs Site] Sync vendored Markdown files into ZT DevDocs bucket (#23593) #5206
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: Publish | |
| on: | |
| push: | |
| branches: | |
| - production | |
| jobs: | |
| publish: | |
| name: Production | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.x | |
| cache: npm | |
| - run: npm ci | |
| - uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| node_modules/.astro/assets | |
| key: static | |
| - run: npm run build | |
| name: Build | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NODE_OPTIONS: --max-old-space-size=4096 | |
| - run: npx wrangler deploy | |
| name: Deploy to Cloudflare Workers | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| - name: Build vendored Markdown archive | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| run: | | |
| npx tsx bin/generate-index-md.ts | |
| cd distmd && zip -r markdown.zip . | |
| npx wrangler r2 object put vendored-markdown/markdown.zip --file=markdown.zip --remote | |
| rm markdown.zip | |
| - name: Upload vendored Markdown files to ZT DevDocs bucket | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.ZT_DEVDOCS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.ZT_DEVDOCS_SECRET_ACCESS_KEY }} | |
| run: | | |
| sudo -v ; curl https://rclone.org/install.sh | sudo bash | |
| rclone sync \ | |
| --s3-env-auth \ | |
| --s3-provider="Cloudflare" \ | |
| --s3-endpoint="https://e76c849bd111ee7d3006b6625713991e.r2.cloudflarestorage.com" \ | |
| distmd \ | |
| :s3:/zt-dashboard-dev-docs | |
| - uses: actions/cache/save@v4 | |
| if: always() | |
| with: | |
| path: | | |
| node_modules/.astro/assets | |
| key: static |