mirror of
https://github.com/soconnor0919/honors-thesis.git
synced 2026-02-04 21:46:31 -05:00
Split CI build into GitHub and Gitea jobs
Add server_url conditionals to dispatch builds to a GitHub specific job and a Gitea-specific job. Add TeX Live caching, checkout and bibtex handling in the Gitea job. Use appropriate upload-artifact action versions for each platform.
This commit is contained in:
64
.github/workflows/build.yml
vendored
64
.github/workflows/build.yml
vendored
@@ -7,9 +7,10 @@ on:
|
|||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-github:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: ghcr.io/xu-cheng/texlive-alpine:latest
|
container: ghcr.io/xu-cheng/texlive-alpine:latest
|
||||||
|
if: github.server_url == 'https://github.com'
|
||||||
steps:
|
steps:
|
||||||
- name: Install system dependencies
|
- name: Install system dependencies
|
||||||
run: apk add --no-cache git make bash nodejs
|
run: apk add --no-cache git make bash nodejs
|
||||||
@@ -47,29 +48,66 @@ jobs:
|
|||||||
pdflatex -output-directory=build -interaction=nonstopmode proposal.tex
|
pdflatex -output-directory=build -interaction=nonstopmode proposal.tex
|
||||||
cp build/proposal.pdf output/proposal.pdf
|
cp build/proposal.pdf output/proposal.pdf
|
||||||
|
|
||||||
- name: Upload Thesis PDF (GitHub)
|
- name: Upload Thesis PDF
|
||||||
if: github.server_url == 'https://github.com'
|
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: thesis-pdf
|
name: thesis-pdf
|
||||||
path: thesis/out/thesis.pdf
|
path: thesis/out/thesis.pdf
|
||||||
|
|
||||||
- name: Upload Thesis PDF (Gitea)
|
- name: Upload Proposal PDF
|
||||||
if: github.server_url != 'https://github.com'
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: thesis-pdf
|
|
||||||
path: thesis/out/thesis.pdf
|
|
||||||
|
|
||||||
- name: Upload Proposal PDF (GitHub)
|
|
||||||
if: github.server_url == 'https://github.com'
|
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: proposal-pdf
|
name: proposal-pdf
|
||||||
path: proposal/output/proposal.pdf
|
path: proposal/output/proposal.pdf
|
||||||
|
|
||||||
- name: Upload Proposal PDF (Gitea)
|
build-gitea:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: ghcr.io/xu-cheng/texlive-alpine:latest
|
||||||
if: github.server_url != 'https://github.com'
|
if: github.server_url != 'https://github.com'
|
||||||
|
steps:
|
||||||
|
- name: Install system dependencies
|
||||||
|
run: apk add --no-cache git make bash nodejs
|
||||||
|
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Cache TeX Live
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
/tmp/texlive
|
||||||
|
~/.texlive*
|
||||||
|
key: texlive-${{ runner.os }}-${{ hashFiles('**/*.tex') }}
|
||||||
|
restore-keys: |
|
||||||
|
texlive-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Create TeX Live directory
|
||||||
|
run: mkdir -p /tmp/texlive
|
||||||
|
|
||||||
|
- name: Build Thesis
|
||||||
|
run: |
|
||||||
|
make -C thesis
|
||||||
|
|
||||||
|
- name: Build Proposal
|
||||||
|
working-directory: proposal
|
||||||
|
run: |
|
||||||
|
mkdir -p build
|
||||||
|
mkdir -p output
|
||||||
|
pdflatex -output-directory=build -interaction=nonstopmode proposal.tex
|
||||||
|
# Run bibtex if aux file exists
|
||||||
|
if [ -f build/proposal.aux ]; then
|
||||||
|
bibtex build/proposal || true
|
||||||
|
fi
|
||||||
|
pdflatex -output-directory=build -interaction=nonstopmode proposal.tex
|
||||||
|
pdflatex -output-directory=build -interaction=nonstopmode proposal.tex
|
||||||
|
cp build/proposal.pdf output/proposal.pdf
|
||||||
|
|
||||||
|
- name: Upload Thesis PDF
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: thesis-pdf
|
||||||
|
path: thesis/out/thesis.pdf
|
||||||
|
|
||||||
|
- name: Upload Proposal PDF
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: proposal-pdf
|
name: proposal-pdf
|
||||||
|
|||||||
Reference in New Issue
Block a user