From dfbe90fa7b9f7e558e823c4010a10457127a8849 Mon Sep 17 00:00:00 2001 From: redtide Date: Mon, 18 Dec 2023 19:58:45 +0100 Subject: [PATCH] GH Actions: replace Jekyll build with MKDocs --- .github/workflows/build.yml | 52 ++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 77b48a64..71073725 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,40 +1,38 @@ -name: Deploy Site - +name: Deploy site on: [push] - jobs: - build-website: - name: Website build + deploy: + name: Linux Ubuntu 22.04 runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 - - name: Install node - uses: actions/setup-node@v2 + uses: actions/checkout@v3 with: - node-version: '14' - cache: 'yarn' - - name: Install ruby - uses: ruby/setup-ruby@v1 + fetch-depth: 0 # needed for accurate dates and blog plugin + - name: Install Python + uses: actions/setup-python@v4 with: - ruby-version: 2.7 - bundler-cache: true - - name: Generate assets - run: yarn --no-bin-links && yarn dist - - name: Build fork - if: ${{ github.repository_owner != 'sfztools' }} - run: | - bundle exec jekyll build \ - --destination public/ \ - --baseurl "/$(echo '${{ github.repository }}' | cut -d/ -f2)" - - name: Build sfztools - if: ${{ github.repository_owner == 'sfztools' }} - run: bundle exec jekyll build --destination public/ + python-version: 3.x + - name: Install Poetry + run: python3 -m pip install --upgrade poetry + - name: Cache build data + uses: actions/cache@v3 + with: + key: mkdocs-cache-${{ runner.os }}-${{ hashFiles('**/poetry.lock', '**/mkdocs.yml') }} + path: .cache + - name: Install dependencies + run: poetry install + - name: Download assets + run: poetry run python3 scripts/assets/download.py + - name: Build assets + run: poetry run python3 scripts/assets/uglify.py + - name: Build site + run: poetry run mkdocs build - name: Upload to GitHub pages - if: ${{ github.ref_name == 'master' && github.event_name != 'pull_request' }} + if: github.ref_name == 'master' && github.event_name != 'pull_request' uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_branch: www - publish_dir: ./public + publish_dir: ./_site force_orphan: true