fix gitlab #11
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: Docs Build and Upload to Cloudflare | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'docs/**' | |
| - 'i18n/**' | |
| - 'src/**' | |
| - 'static/**' | |
| - '**.js' | |
| - '!docs/_list' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: make install | |
| env: | |
| CI: true | |
| - name: Build documentation | |
| run: make build | |
| env: | |
| CI: true | |
| - name: Verify build output | |
| run: | | |
| if [ ! -d "build" ]; then | |
| echo "Error: build directory not found" | |
| exit 1 | |
| fi | |
| if [ ! -f "build/index.html" ]; then | |
| echo "Error: build/index.html not found" | |
| exit 1 | |
| fi | |
| echo "Build verification passed" | |
| - name: Publish to Cloudflare Pages | |
| if: success() | |
| uses: cloudflare/pages-action@v1 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: eb79f13320db531d8cf1f3720966b695 | |
| projectName: handbook | |
| directory: build | |
| gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
| branch: main |