Skip to content

Commit

Permalink
split workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
NoozAbooz committed Aug 15, 2024
1 parent 2b450c5 commit d21ce34
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 62 deletions.
61 changes: 2 additions & 59 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Project
name: Build Project w/ PROS

on:
push:
Expand Down Expand Up @@ -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/[email protected]
# 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/<owner>/<repo>/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
run: pros make clean all
70 changes: 70 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
# 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/<owner>/<repo>/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
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="https://raw.githubusercontent.com/NoozAbooz/2088S-HighStakes-2025/V1/logo.png">
<link rel="icon" type="image/x-icon" href="https://raw.githubusercontent.com/NoozAbooz/210K-HighStakes-2025/V1/logo.png">
</head>

<body>
<object data="https://noozabooz.github.io/2088S-HighStakes-2025/main.pdf#zoom=80%" type="application/pdf" width="100%" height="100%">
<object data="https://noozabooz.github.io/210K-HighStakes-2025/main.pdf#zoom=80%" type="application/pdf" width="100%" height="100%">
<!-- <p>It appears you don't have a PDF plugin for this browser.
No biggie... you can <a href="https://github.com/NoozAbooz/2088S-OverUnder-2024/releases/download/v2/main.pdf">click here to
No biggie... you can <a href="https://github.com/NoozAbooz/2088S-OverUnder-2024/releases/download/v1/main.pdf">click here to
download the PDF file.</a></p> -->
</object>
</body>
Expand Down

0 comments on commit d21ce34

Please sign in to comment.