|
| 1 | +name: CI for specs |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + paths: [ document ] |
| 7 | + |
| 8 | + pull_request: |
| 9 | + branches: [ main ] |
| 10 | + paths: [ document ] |
| 11 | + |
| 12 | + # Allows you to run this workflow manually from the Actions tab |
| 13 | + workflow_dispatch: |
| 14 | + |
| 15 | +jobs: |
| 16 | + build-core-spec: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - name: Checkout repo |
| 20 | + uses: actions/checkout@v2 |
| 21 | + with: |
| 22 | + submodules: "recursive" |
| 23 | + - name: Setup Node.js |
| 24 | + uses: actions/setup-node@v3 |
| 25 | + with: |
| 26 | + node-version: 16 |
| 27 | + - name: Setup Bikeshed |
| 28 | + run: pip install bikeshed && bikeshed update |
| 29 | + - name: Setup TexLive |
| 30 | + run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended |
| 31 | + - name: Setup Sphinx |
| 32 | + run: pip install six && pip install sphinx==5.1.0 |
| 33 | + - name: Build main spec |
| 34 | + run: cd document/core && make main |
| 35 | + - name: Run Bikeshed |
| 36 | + run: cd document/core && make bikeshed |
| 37 | + - name: Upload artifact |
| 38 | + uses: actions/upload-artifact@v2 |
| 39 | + with: |
| 40 | + name: core-rendered |
| 41 | + path: document/core/_build/html |
| 42 | + |
| 43 | + build-js-api-spec: |
| 44 | + runs-on: ubuntu-latest |
| 45 | + steps: |
| 46 | + - name: Checkout repo |
| 47 | + uses: actions/checkout@v2 |
| 48 | + - name: Setup Bikeshed |
| 49 | + run: pip install bikeshed && bikeshed update |
| 50 | + - name: Run Bikeshed |
| 51 | + run: bikeshed spec "document/js-api/index.bs" "document/js-api/index.html" |
| 52 | + - name: Upload artifact |
| 53 | + uses: actions/upload-artifact@v2 |
| 54 | + with: |
| 55 | + name: js-api-rendered |
| 56 | + path: document/js-api/index.html |
| 57 | + |
| 58 | + build-web-api-spec: |
| 59 | + runs-on: ubuntu-latest |
| 60 | + steps: |
| 61 | + - name: Checkout repo |
| 62 | + uses: actions/checkout@v2 |
| 63 | + - name: Setup Bikeshed |
| 64 | + run: pip install bikeshed && bikeshed update |
| 65 | + - name: Run Bikeshed |
| 66 | + run: bikeshed spec "document/web-api/index.bs" "document/web-api/index.html" |
| 67 | + - name: Upload artifact |
| 68 | + uses: actions/upload-artifact@v2 |
| 69 | + with: |
| 70 | + name: web-api-rendered |
| 71 | + path: document/web-api/index.html |
| 72 | + |
| 73 | + publish-spec: |
| 74 | + runs-on: ubuntu-latest |
| 75 | + needs: [build-core-spec, build-js-api-spec, build-web-api-spec] |
| 76 | + steps: |
| 77 | + - name: Checkout repo |
| 78 | + uses: actions/checkout@v2 |
| 79 | + - name: Create output directory |
| 80 | + run: mkdir _output && cp document/index.html _output/index.html |
| 81 | + - name: Download core spec artifact |
| 82 | + uses: actions/download-artifact@v2 |
| 83 | + with: |
| 84 | + name: core-rendered |
| 85 | + path: _output/core |
| 86 | + - name: Download JS API spec artifact |
| 87 | + uses: actions/download-artifact@v2 |
| 88 | + with: |
| 89 | + name: js-api-rendered |
| 90 | + path: _output/js-api |
| 91 | + - name: Download Web API spec artifact |
| 92 | + uses: actions/download-artifact@v2 |
| 93 | + with: |
| 94 | + name: web-api-rendered |
| 95 | + path: _output/web-api |
| 96 | + - name: Publish to GitHub Pages |
| 97 | + if: github.ref == 'refs/heads/main' |
| 98 | + uses: peaceiris/actions-gh-pages@v3 |
| 99 | + with: |
| 100 | + publish_dir: ./_output |
| 101 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments