feat(typography): update styles in typography.scss #786
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Jekyll | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
concurrency: | |
group: 'gh-pages' | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: github-pages | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 5 | |
- name: Setup Python 3.10.x | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10.x" | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Output Git Diff | |
run: | | |
git diff --name-only HEAD~1 HEAD | |
- name: Update Language Files Amend | |
id: updated_lang_files_amend | |
run: | | |
DRY_RUN_LANG_OUTPUT=$(python scripts/update_lang_amend.py --dry_run) | |
TOTAL_POSTS=$(echo "$DRY_RUN_LANG_OUTPUT" | grep "Total Markdown files to process:" | awk '{print $NF}') | |
echo "Total posts to process: $TOTAL_POSTS" | |
if [[ "$TOTAL_POSTS" -eq 0 ]]; then | |
echo "No language files to amend." | |
else | |
MAX_FILES_PER_RUN=1 | |
for ((i=0; i < TOTAL_POSTS; i+=MAX_FILES_PER_RUN)); do | |
python scripts/update_lang_amend.py --max_files "$MAX_FILES_PER_RUN" | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add _posts/**/*.md | |
if ! git diff --cached --quiet; then | |
git commit -m "chore(lang): Update language files" | |
git push || { | |
echo "Push failed, attempting pull and merge" | |
git pull --rebase | |
git push | |
} | |
fi | |
done | |
fi | |
env: | |
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }} | |
- name: Update Language Files | |
id: updated_lang_files | |
run: | | |
DRY_RUN_LANG_OUTPUT=$(python scripts/update_lang.py --dry_run) | |
TOTAL_POSTS=$(echo "$DRY_RUN_LANG_OUTPUT" | grep "Total Markdown files to process:" | awk '{print $NF}') | |
echo "Total posts to process: $TOTAL_POSTS" | |
if [[ "$TOTAL_POSTS" -eq 0 ]]; then | |
echo "No language files to update." | |
else | |
for i in $(seq 1 "$TOTAL_POSTS"); do | |
python scripts/update_lang.py --max_files 1 --model mistral | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add _posts/**/*.md | |
git diff --cached --quiet || git commit -m "chore(lang): Update language files" | |
git push || { | |
echo "Push failed, attempting pull and merge" | |
git pull --rebase | |
git push | |
} | |
done | |
fi | |
env: | |
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }} | |
- name: Dry Run Pdf Files | |
id: dry_run_pdf | |
run: | | |
DRY_RUN_PDF_OUTPUT=$(python scripts/update_pdf.py --max_files 1000 --dry_run) | |
echo "$DRY_RUN_PDF_OUTPUT" | |
if [[ "$DRY_RUN_PDF_OUTPUT" == *'Total Markdown files to process: 0'* ]]; then | |
echo "pdf_updated=false" >> "$GITHUB_OUTPUT" | |
else | |
echo "pdf_updated=true" >> "$GITHUB_OUTPUT" | |
fi | |
- name: Install Microsoft Core Fonts | |
if: steps.dry_run_pdf.outputs.pdf_updated == 'true' | |
run: | | |
sudo apt-get install -y ttf-mscorefonts-installer | |
fc-cache -fv | |
- name: Install Noto Fonts | |
if: steps.dry_run_pdf.outputs.pdf_updated == 'true' | |
run: | | |
sudo apt-get install -y fonts-noto | |
- name: Install Noto CJK | |
if: steps.dry_run_pdf.outputs.pdf_updated == 'true' | |
run: | | |
sudo apt-get install -y fonts-noto-cjk | |
- name: Install DejaVu Fonts | |
if: steps.dry_run_pdf.outputs.pdf_updated == 'true' | |
run: | | |
sudo apt-get install -y fonts-dejavu | |
- name: List Installed Fonts | |
if: steps.dry_run_pdf.outputs.pdf_updated == 'true' | |
run: fc-list | |
- name: Setup TeX Live | |
if: steps.dry_run_pdf.outputs.pdf_updated == 'true' | |
uses: teatimeguest/setup-texlive-action@v3 | |
with: | |
packages: | | |
xeCJK | |
etoolbox | |
adjustbox | |
roboto | |
sourcesanspro | |
fontawesome5 | |
tcolorbox | |
setspace | |
unicode-math | |
fancyvrb | |
olyglossia | |
polyglossia | |
bidi | |
booktabs | |
footnote | |
- name: Install Pandoc | |
if: steps.dry_run_pdf.outputs.pdf_updated == 'true' | |
run: sudo apt-get update && sudo apt-get install -y pandoc | |
- name: Run Pdf-Pipeline.py | |
if: steps.dry_run_pdf.outputs.pdf_updated == 'true' | |
run: | | |
python scripts/update_pdf.py --max_files 1000 | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add assets/pdfs/**/*.pdf | |
git diff --cached --quiet || git commit -m "chore(pdf): Update PDF files" | |
git push || { | |
echo "Push failed, attempting pull and merge" | |
git pull --rebase | |
git push | |
} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Authenticate with GCP | |
uses: google-github-actions/auth@v1 | |
with: | |
credentials_json: ${{ secrets.GCP_SA_KEY }} | |
- name: Dry run Audio Pipeline | |
id: dry_run_audio | |
run: | | |
DRY_RUN_OUTPUT=$(python scripts/audio_pipeline.py --task posts --n 2 --dry_run) | |
echo "$DRY_RUN_OUTPUT" | |
FILES_PROCESSED=$(echo "$DRY_RUN_OUTPUT" | grep "Processing complete!" | awk '{print $3}' | cut -d'/' -f1) | |
TOTAL_FILES=$(echo "$DRY_RUN_OUTPUT" | grep "Processing complete!" | awk '{print $3}' | cut -d'/' -f2) | |
if [[ "$FILES_PROCESSED" -gt 0 && "$FILES_PROCESSED" -eq "$TOTAL_FILES" ]]; then | |
echo "audio_updated=true" >> "$GITHUB_OUTPUT" | |
else | |
echo "audio_updated=false" >> "$GITHUB_OUTPUT" | |
fi | |
- name: Install FFmpeg | |
if: steps.dry_run_audio.outputs.audio_updated == 'true' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y ffmpeg | |
- name: Run Audio Pipeline | |
if: steps.dry_run_audio.outputs.audio_updated == 'true' | |
run: | | |
python scripts/audio_pipeline.py --task posts --n 2 --max_files 20 | |
- name: Clean Up Credentials | |
run: | | |
rm -f ./gha-creds-*.json | |
- name: Commit generated audio files | |
if: steps.dry_run_audio.outputs.audio_updated == 'true' | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add . | |
git diff --cached --quiet || git commit -m "Add generated audio files" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: ./ | |
destination: ./_site | |
- name: Upload Artifact | |
uses: actions/upload-pages-artifact@v3 | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |