Merge pull request #1337 from melonjs/chore/fix-npm-readme #399
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: Documentation & Examples | |
| on: | |
| push: | |
| branches: [master] | |
| concurrency: | |
| group: docs-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| - uses: pnpm/action-setup@v4 | |
| - name: Get pnpm store directory | |
| run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - uses: actions/cache@v5 | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: ${{ runner.os }}-pnpm-store- | |
| - run: pnpm i | |
| - name: Build melonjs | |
| run: pnpm -F melonjs build | |
| - name: Build debug plugin | |
| run: pnpm -F @melonjs/debug-plugin build | |
| - name: Build tiled-inflate-plugin | |
| run: pnpm -F @melonjs/tiled-inflate-plugin build | |
| - name: Build spine-plugin | |
| run: pnpm -F @melonjs/spine-plugin build | |
| - name: Build API docs | |
| run: pnpm doc | |
| - name: Build examples | |
| run: pnpm -F examples build | |
| env: | |
| VITE_BASE_PATH: /melonJS/examples/ | |
| - name: Combine docs and examples | |
| run: | | |
| mkdir -p packages/melonjs/docs/examples | |
| cp -r packages/examples/dist/* packages/melonjs/docs/examples/ | |
| - name: Upload GitHub Pages artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: packages/melonjs/docs/ | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: api-reference | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |