2024-05-15 16:35:30 +00:00
|
|
|
name: Deploy Docs
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy-docs:
|
|
|
|
name: Deploy Docs
|
2024-10-17 16:50:19 +00:00
|
|
|
if: github.repository_owner == 'zed-industries'
|
2024-05-15 16:35:30 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2024-10-09 22:24:10 +00:00
|
|
|
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
|
2024-05-15 16:35:30 +00:00
|
|
|
with:
|
|
|
|
clean: false
|
|
|
|
|
|
|
|
- name: Setup mdBook
|
2024-07-25 13:19:05 +00:00
|
|
|
uses: peaceiris/actions-mdbook@ee69d230fe19748b7abf22df32acaa93833fad08 # v2
|
2024-05-15 16:35:30 +00:00
|
|
|
with:
|
|
|
|
mdbook-version: "0.4.37"
|
|
|
|
|
2024-08-26 16:06:45 +00:00
|
|
|
- name: Set up default .cargo/config.toml
|
|
|
|
run: cp ./.cargo/collab-config.toml ./.cargo/config.toml
|
2024-08-26 15:54:42 +00:00
|
|
|
|
2024-08-26 16:48:46 +00:00
|
|
|
- name: Install system dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install libxkbcommon-dev libxkbcommon-x11-dev
|
|
|
|
|
2024-05-15 16:35:30 +00:00
|
|
|
- name: Build book
|
|
|
|
run: |
|
|
|
|
set -euo pipefail
|
|
|
|
mkdir -p target/deploy
|
|
|
|
mdbook build ./docs --dest-dir=../target/deploy/docs/
|
|
|
|
|
|
|
|
- name: Deploy Docs
|
2024-10-09 21:19:11 +00:00
|
|
|
uses: cloudflare/wrangler-action@9681c2997648301493e78cacbfb790a9f19c833f # v3
|
2024-05-15 16:35:30 +00:00
|
|
|
with:
|
|
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
|
|
command: pages deploy target/deploy --project-name=docs
|
|
|
|
|
|
|
|
- name: Deploy Install
|
2024-10-09 21:19:11 +00:00
|
|
|
uses: cloudflare/wrangler-action@9681c2997648301493e78cacbfb790a9f19c833f # v3
|
2024-05-15 16:35:30 +00:00
|
|
|
with:
|
|
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
|
|
command: r2 object put -f script/install.sh zed-open-source-website-assets/install.sh
|
|
|
|
|
|
|
|
- name: Deploy Docs Workers
|
2024-10-09 21:19:11 +00:00
|
|
|
uses: cloudflare/wrangler-action@9681c2997648301493e78cacbfb790a9f19c833f # v3
|
2024-05-15 16:35:30 +00:00
|
|
|
with:
|
|
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
|
|
command: deploy .cloudflare/docs-proxy/src/worker.js
|
|
|
|
|
|
|
|
- name: Deploy Install Workers
|
2024-10-09 21:19:11 +00:00
|
|
|
uses: cloudflare/wrangler-action@9681c2997648301493e78cacbfb790a9f19c833f # v3
|
2024-05-15 16:35:30 +00:00
|
|
|
with:
|
|
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
|
|
command: deploy .cloudflare/docs-proxy/src/worker.js
|