Skip to content

Commit

Permalink
Use JamesIves/github-pages-deploy-action
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkWieczorek committed Jan 4, 2025
1 parent c62cc4c commit ff3f799
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit ff3f799

Please sign in to comment.