Update build.yml #12
This file contains 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
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | |
name: Build Blog | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: latest | |
- name: Install softwatre dependencies | |
run: sudo apt-get install -y highlight imagemagick ipe bzip2 inkscape | |
- name: Setting up online LaTeX compilation | |
run: mkdir -p ~/.ipe/latexrun; echo "https://latexonline.cc" > ~/.ipe/latexrun/url1.txt | |
- name: Install soupault | |
env: | |
SOUPAULT_VERSION: 4.10.0 | |
run: | | |
wget https://github.com/PataphysicalSociety/soupault/releases/download/$SOUPAULT_VERSION/soupault-$SOUPAULT_VERSION-linux-x86_64.tar.gz | |
tar xvf soupault-$SOUPAULT_VERSION-linux-x86_64.tar.gz | |
sudo mv -v ./soupault-$SOUPAULT_VERSION-linux-x86_64/soupault /usr/bin/ | |
rm -rf soupault-$SOUPAULT_VERSION-linux-x86_64.tar.gz soupault-$SOUPAULT_VERSION-linux-x86_64 | |
- name: Install pnpm dependencies | |
run: pnpm i | |
- name: Check formatting | |
run: pnpm exec prettier . --check | |
- name: Build | |
run: make build | |
- name: Install netlify tools | |
run: pnpm install -g netlify-cli | |
- name: Deploy to Netlify | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
run: netlify deploy --dir build --site $NETLIFY_SITE_ID --auth $NETLIFY_AUTH_TOKEN --prod |