diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..9997889 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,83 @@ +name: Build CGGMP21 Spec & Docs + +on: + pull_request: + branches: [ "*" ] + paths: + - 'cggmp21/**' + - 'spec/**' + - '.github/workflows/docs.yml' + push: + branches: [ "m" ] + +jobs: + build_pdf: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: actions/checkout@v3 + - name: Compile LaTeX document + uses: xu-cheng/latex-action@v3 + with: + root_file: main.tex + working_directory: spec + - name: Rename PDF + run: mv spec/main.pdf spec/cggmp21-spec.pdf + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: spec-pdf + path: spec/cggmp21-spec.pdf + - name: Leave PR comment + continue-on-error: true + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: spec_is_built + message: The spec was successfully compiled. PDF is available in the artifacts. + build_docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@nightly + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: "true" + - name: Build docs + run: make docs && cp docs/redirect.html target/doc/index.html + - name: Upload docs + uses: actions/upload-artifact@v4 + with: + name: docs + path: target/doc + deploy_pages: + runs-on: ubuntu-latest + needs: [build_pdf, build_docs] + # if: github.ref == 'refs/heads/m' + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + permissions: + pages: write + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + name: docs + path: website + - uses: actions/download-artifact@v4 + with: + name: spec-pdf + path: website/cggmp21-spec.pdf + - name: Prepare Github Pages deployment + run: | + mkdir public + cp README.md public/index.md + cp cggmp21-specs.pdf public + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: 'website' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/docs/redirect.html b/docs/redirect.html new file mode 100644 index 0000000..e817cc5 --- /dev/null +++ b/docs/redirect.html @@ -0,0 +1,12 @@ + + + + + Redirection + + + +

+ You are being redirected to another page. Click here if it didn't work. +

+ \ No newline at end of file