Merge branch 'main' of https://github.com/Battlefield6/API #12
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: Build Documentation | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| jobs: | |
| build-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout main repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24.1.0' | |
| - name: Cache protoc | |
| id: cache-protoc | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| /usr/bin/protoc | |
| /usr/include/google | |
| key: ${{ runner.os }}-protoc-3 | |
| - name: Install Protocol Buffers Compiler | |
| if: steps.cache-protoc.outputs.cache-hit != 'true' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y protobuf-compiler | |
| - name: Verify protoc installation | |
| run: protoc --version | |
| - name: Checkout Wiki repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ github.repository }}.wiki | |
| path: .wiki | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install dependencies (without prepare script) | |
| run: npm install --ignore-scripts | |
| - name: Generate proto files | |
| run: npm run proto:generate | |
| - name: Create index.ts for generated files | |
| run: | | |
| echo "export * from './Main';" > src/generated/index.ts | |
| - name: Build TypeScript | |
| run: npm run build | |
| - name: Configure Git for documentation | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Generate documentation | |
| run: npm run docs | |
| - name: Commit and push wiki changes | |
| run: | | |
| cd .wiki | |
| git diff --quiet && git diff --staged --quiet || echo "Changes already committed by docs script" |