From d21ce346c325a14e5082d00729078ef5fb053e24 Mon Sep 17 00:00:00 2001 From: Michael Zheng Date: Thu, 15 Aug 2024 10:59:13 -0600 Subject: [PATCH] split workflows --- .github/workflows/build.yml | 61 ++------------------------------ .github/workflows/docs.yml | 70 +++++++++++++++++++++++++++++++++++++ docs/index.html | 6 ++-- 3 files changed, 75 insertions(+), 62 deletions(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae09e5c..3717305 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build Project +name: Build Project w/ PROS on: push: @@ -50,61 +50,4 @@ jobs: uses: actions/checkout@v3 - name: Build PROS Project - run: pros make clean all - - docs: - name: Compile Docs - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: 3.9 - - - name: Generate LaTeX Files - run: | - python scripts/prosToMinted.py - cp logo.png docs/output/ - shell: sh - - - name: Compile LaTeX document - uses: xu-cheng/latex-action@v3 - with: - working_directory: 'docs/output/' - - root_file: main.tex - latexmk_shell_escape: true - latexmk_use_xelatex: true - - - name: Copy PDF - run: | - cp docs/output/main.pdf docs/main.pdf - sudo rm -rf docs/output - rm docs/output.zip - shell: sh - - # - name: Update PDF release - # uses: WebFreak001/deploy-nightly@v3.0.0 - # with: - # upload_url: https://uploads.github.com/repos/NoozAbooz/2088S-OverUnder-2024/releases/135895802/assets{?name,label} # find out this value by opening https://api.github.com/repos///releases in your browser and copy the full "upload_url" value including the {?name,label} part - # release_id: 135895802 # same as above (id can just be taken out the upload_url, it's used to find old releases) - # asset_path: ./docs/main.pdf # path to archive to upload - # asset_name: main.pdf # name to upload the release as, use $$ to insert date (YYYYMMDD) and 6 letter commit hash - # asset_content_type: application/zip # required by GitHub API - # max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted - # token: ${{ secrets.GITHUB_TOKEN }} - - - name: Setup Pages - uses: actions/configure-pages@v4 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - # Upload entire repository - path: './docs/' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + run: pros make clean all \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..1fa194b --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,70 @@ +name: Compile LaTeX Docs + +on: + push: + branches: '*' + + workflow_dispatch: + +permissions: + contents: write + pages: write + id-token: write + +jobs: + docs: + name: Compile Docs + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Generate LaTeX Files + run: | + python scripts/prosToMinted.py + cp logo.png docs/output/ + shell: sh + + - name: Compile LaTeX document + uses: xu-cheng/latex-action@v3 + with: + working_directory: 'docs/output/' + + root_file: main.tex + latexmk_shell_escape: true + latexmk_use_xelatex: true + + - name: Copy PDF + run: | + cp docs/output/main.pdf docs/main.pdf + sudo rm -rf docs/output + rm docs/output.zip + shell: sh + + # - name: Update PDF release + # uses: WebFreak001/deploy-nightly@v3.0.0 + # with: + # upload_url: https://uploads.github.com/repos/NoozAbooz/2088S-OverUnder-2024/releases/135895802/assets{?name,label} # find out this value by opening https://api.github.com/repos///releases in your browser and copy the full "upload_url" value including the {?name,label} part + # release_id: 135895802 # same as above (id can just be taken out the upload_url, it's used to find old releases) + # asset_path: ./docs/main.pdf # path to archive to upload + # asset_name: main.pdf # name to upload the release as, use $$ to insert date (YYYYMMDD) and 6 letter commit hash + # asset_content_type: application/zip # required by GitHub API + # max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted + # token: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + # Upload entire repository + path: './docs/' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 5e68f8f..d032384 100644 --- a/docs/index.html +++ b/docs/index.html @@ -3,13 +3,13 @@ - + - +