|
7 | 7 |
|
8 | 8 | jobs:
|
9 | 9 | docs:
|
10 |
| - uses: pmndrs/docs/.github/workflows/build.yml@v2 |
11 |
| - with: |
12 |
| - mdx: 'docs' |
13 |
| - libname: 'xr' |
14 |
| - base_path: '/xr/docs' |
15 |
| - icon: '🤳' |
16 |
| - github: 'https://github.com/pmndrs/xr' |
17 |
| - home_redirect: '/getting-started/introduction' |
| 10 | + runs-on: ubuntu-latest |
| 11 | + |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v4 |
| 14 | + |
| 15 | + - name: Setup Node |
| 16 | + uses: actions/setup-node@v3 |
| 17 | + with: |
| 18 | + node-version: 18 |
| 19 | + |
| 20 | + - uses: pnpm/action-setup@v2 |
| 21 | + name: Install pnpm |
| 22 | + with: |
| 23 | + version: 8 |
| 24 | + run_install: true |
| 25 | + |
| 26 | + - name: Generate Docs |
| 27 | + run: pnpm --filter packages/react/xr generate:docs |
| 28 | + |
| 29 | + - id: configurepages |
| 30 | + uses: actions/configure-pages@v5 |
| 31 | + # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#example-of-setting-an-output-parameter |
| 32 | + - id: set-base-path |
| 33 | + run: echo "BASE_PATH=${{ '/xr/docs' || steps.configurepages.outputs.base_path }}" >> "$GITHUB_OUTPUT" |
| 34 | + - run: | |
| 35 | + set -ex |
| 36 | +
|
| 37 | + docker run --rm --init \ |
| 38 | + -v "./$MDX":/app/docs \ |
| 39 | + -e BASE_PATH \ |
| 40 | + -e DIST_DIR="$MDX/out$BASE_PATH" \ |
| 41 | + -e MDX \ |
| 42 | + -e NEXT_PUBLIC_LIBNAME \ |
| 43 | + -e NEXT_PUBLIC_LIBNAME_SHORT \ |
| 44 | + -e NEXT_PUBLIC_LIBNAME_DOTSUFFIX_LABEL \ |
| 45 | + -e NEXT_PUBLIC_LIBNAME_DOTSUFFIX_HREF \ |
| 46 | + -e OUTPUT=export \ |
| 47 | + -e HOME_REDIRECT \ |
| 48 | + -e MDX_BASEURL \ |
| 49 | + -e SOURCECODE_BASEURL \ |
| 50 | + -e EDIT_BASEURL \ |
| 51 | + -e NEXT_PUBLIC_URL \ |
| 52 | + -e ICON \ |
| 53 | + -e LOGO \ |
| 54 | + -e GITHUB \ |
| 55 | + -e DISCORD \ |
| 56 | + -e THEME_PRIMARY \ |
| 57 | + -e THEME_SCHEME \ |
| 58 | + -e THEME_CONTRAST \ |
| 59 | + -e THEME_NOTE \ |
| 60 | + -e THEME_TIP \ |
| 61 | + -e THEME_IMPORTANT \ |
| 62 | + -e THEME_WARNING \ |
| 63 | + -e THEME_CAUTION \ |
| 64 | + -e CONTRIBUTORS_PAT \ |
| 65 | + ghcr.io/pmndrs/docs:2 npm run build |
| 66 | + env: |
| 67 | + BASE_PATH: ${{ steps.set-base-path.outputs.BASE_PATH }} |
| 68 | + MDX: 'docs' |
| 69 | + NEXT_PUBLIC_LIBNAME: 'xr' |
| 70 | + NEXT_PUBLIC_LIBNAME_SHORT: '' |
| 71 | + NEXT_PUBLIC_LIBNAME_DOTSUFFIX_LABEL: 'docs' |
| 72 | + NEXT_PUBLIC_LIBNAME_DOTSUFFIX_HREF: 'https://docs.pmnd.rs' |
| 73 | + HOME_REDIRECT: '/getting-started/introduction' |
| 74 | + MDX_BASEURL: 'https://github.com/${{ github.repository }}/raw/${{ github.ref_name }}/docs' |
| 75 | + SOURCECODE_BASEURL: 'https://github.com/${{ github.repository }}/tree/${{ github.ref_name }}' |
| 76 | + EDIT_BASEURL: 'https://github.com/${{ github.repository }}/edit/${{ github.ref_name }}/docs' |
| 77 | + NEXT_PUBLIC_URL: ${{ steps.configurepages.outputs.base_url }} |
| 78 | + ICON: '🤳' |
| 79 | + LOGO: '/logo.png' |
| 80 | + GITHUB: 'https://github.com/pmndrs/xr' |
| 81 | + DISCORD: '' |
| 82 | + THEME_PRIMARY: '#323e48' |
| 83 | + THEME_SCHEME: 'tonalSpot' |
| 84 | + THEME_CONTRAST: '0' |
| 85 | + THEME_NOTE: '#1f6feb' |
| 86 | + THEME_TIP: '#238636' |
| 87 | + THEME_IMPORTANT: '#8957e5' |
| 88 | + THEME_WARNING: '#d29922' |
| 89 | + THEME_CAUTION: '#da3633' |
| 90 | + CONTRIBUTORS_PAT: ${{ secrets.GITHUB_TOKEN }} |
| 91 | +
|
| 92 | + - uses: actions/upload-pages-artifact@v3 |
| 93 | + with: |
| 94 | + path: docs/out${{ steps.set-base-path.outputs.BASE_PATH }} |
18 | 95 |
|
19 | 96 | examples:
|
20 | 97 | runs-on: ubuntu-latest
|
|
0 commit comments