diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml new file mode 100644 index 00000000..bc0fe834 --- /dev/null +++ b/.github/workflows/jekyll.yml @@ -0,0 +1,68 @@ +name: Build and deploy website +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 # FIXME: add apt(latex) + with: + path: vendor/bundle + key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }} + restore-keys: | + ${{ runner.os }}-gems- + - uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '.github/python/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install TeXLive + uses: DanySK/setup-texlive-action@0.1.1 + - id: setup-python + name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: Install dependencies + run: python -m pip install -r .github/python/requirements.txt + - name: Building notes + run: make ready + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + - name: Install bundler and dependencies + run: | + gem install bundler + bundle install + - name: Build website + run: bundle exec jekyll build + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: _site + + deploy: + needs: build + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + if: > + success() + && github.ref == 'refs/heads/main' + id: deployment + uses: actions/deploy-pages@v4