From ff3f799f73581d4ec52b0548a1ba027f0aa273f2 Mon Sep 17 00:00:00 2001 From: Mark Wieczorek Date: Sat, 4 Jan 2025 18:40:58 +0100 Subject: [PATCH] Use JamesIves/github-pages-deploy-action --- .github/workflows/deploy.yml | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7363012f98a0..6f021dd8bd62 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,6 +10,13 @@ on: - master - main +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: write + jobs: deploy: runs-on: ubuntu-latest @@ -21,23 +28,18 @@ jobs: with: ruby-version: '3.3.5' bundler-cache: true - - name: Install deps + - name: Install dependencies and build run: | npm install -g @mermaid-js/mermaid-cli sudo apt-get update && sudo apt-get install -y imagemagick - - name: Setup deploy options - id: setup + export JEKYLL_ENV=production + bundle exec jekyll build + - name: Purge unused CSS run: | - git config --global user.name "GitHub Action" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - if [[ ${GITHUB_REF} = refs/pull/*/merge ]]; then # pull request - echo "::set-output name=SRC_BRANCH::${GITHUB_HEAD_REF}" - echo "::set-output name=NO_PUSH::--no-push" - elif [[ ${GITHUB_REF} = refs/heads/* ]]; then # branch, e.g. master, source etc - echo "::set-output name=SRC_BRANCH::${GITHUB_REF#refs/heads/}" - fi - echo "::set-output name=DEPLOY_BRANCH::gh-pages" - - name: Deploy website - run: yes | bash bin/deploy --verbose ${{ steps.setup.outputs.NO_PUSH }} - --src ${{ steps.setup.outputs.SRC_BRANCH }} - --deploy ${{ steps.setup.outputs.DEPLOY_BRANCH }} + npm install -g purgecss + purgecss -c purgecss.config.js + - name: Deploy + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: _site