Skip to content

Commit 264efd1

Browse files
committed
test latest deploy.yml from al.folio
1 parent 7627250 commit 264efd1

File tree

1 file changed

+80
-30
lines changed

1 file changed

+80
-30
lines changed

.github/workflows/deploy.yml

Lines changed: 80 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,95 @@
1-
name: deploy
1+
name: Deploy site
22

33
on:
44
push:
55
branches:
66
- master
77
- main
8+
paths:
9+
- "assets/**"
10+
- "**.bib"
11+
- "**.html"
12+
- "**.js"
13+
- "**.liquid"
14+
- "**/*.md"
15+
- "**.yml"
16+
- "Gemfile"
17+
- "Gemfile.lock"
18+
- "!.github/workflows/axe.yml"
19+
- "!.github/workflows/broken-links.yml"
20+
- "!.github/workflows/deploy-docker-tag.yml"
21+
- "!.github/workflows/deploy-image.yml"
22+
- "!.github/workflows/docker-slim.yml"
23+
- "!.github/workflows/lighthouse-badger.yml"
24+
- "!.github/workflows/prettier.yml"
25+
- "!lighthouse_results/**"
26+
- "!CONTRIBUTING.md"
27+
- "!CUSTOMIZE.md"
28+
- "!FAQ.md"
29+
- "!INSTALL.md"
30+
- "!README.md"
831
pull_request:
932
branches:
1033
- master
1134
- main
35+
paths:
36+
- "assets/**"
37+
- "**.bib"
38+
- "**.html"
39+
- "**.js"
40+
- "**.liquid"
41+
- "**/*.md"
42+
- "**.yml"
43+
- "Gemfile"
44+
- "Gemfile.lock"
45+
- "!.github/workflows/axe.yml"
46+
- "!.github/workflows/broken-links.yml"
47+
- "!.github/workflows/deploy-docker-tag.yml"
48+
- "!.github/workflows/deploy-image.yml"
49+
- "!.github/workflows/docker-slim.yml"
50+
- "!.github/workflows/lighthouse-badger.yml"
51+
- "!.github/workflows/prettier.yml"
52+
- "!lighthouse_results/**"
53+
- "!CONTRIBUTING.md"
54+
- "!CUSTOMIZE.md"
55+
- "!FAQ.md"
56+
- "!INSTALL.md"
57+
- "!README.md"
58+
workflow_dispatch:
59+
60+
permissions:
61+
contents: write
1262

1363
jobs:
1464
deploy:
65+
# available images: https://github.com/actions/runner-images#available-images
1566
runs-on: ubuntu-latest
1667
steps:
17-
- name: Checkout code
18-
uses: actions/checkout@v3
19-
- name: Setup Ruby
20-
uses: ruby/setup-ruby@v1
21-
with:
22-
ruby-version: '3.0.2'
23-
bundler-cache: true
24-
- name: Install deps
25-
run: |
26-
gem install bundler
27-
bundle update --bundler
28-
bundle install
29-
npm install -g mermaid.cli
30-
- name: Setup deploy options
31-
id: setup
32-
run: |
33-
git config --global user.name "GitHub Action"
34-
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
35-
if [[ ${GITHUB_REF} = refs/pull/*/merge ]]; then # pull request
36-
echo "SRC_BRANCH=${GITHUB_HEAD_REF}" >> $GITHUB_OUTPUT
37-
echo "NO_PUSH=--no-push" >> $GITHUB_OUTPUT
38-
elif [[ ${GITHUB_REF} = refs/heads/* ]]; then # branch, e.g. master, source etc
39-
echo "SRC_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
40-
fi
41-
echo "DEPLOY_BRANCH=gh-pages" >> $GITHUB_OUTPUT
42-
- name: Deploy website
43-
run: yes | bash bin/deploy --verbose ${{ steps.setup.outputs.NO_PUSH }}
44-
--src ${{ steps.setup.outputs.SRC_BRANCH }}
45-
--deploy ${{ steps.setup.outputs.DEPLOY_BRANCH }}
68+
- name: Checkout 🛎️
69+
uses: actions/checkout@v4
70+
- name: Setup Ruby
71+
uses: ruby/setup-ruby@v1
72+
with:
73+
ruby-version: "3.2.2"
74+
bundler-cache: true
75+
- name: Update _config.yml ⚙️
76+
uses: fjogeleit/yaml-update-action@main
77+
with:
78+
commitChange: false
79+
valueFile: "_config.yml"
80+
propertyPath: "giscus.repo"
81+
value: ${{ github.repository }}
82+
- name: Install and Build 🔧
83+
run: |
84+
pip3 install --upgrade jupyter
85+
export JEKYLL_ENV=production
86+
bundle exec jekyll build
87+
- name: Purge unused CSS 🧹
88+
run: |
89+
npm install -g purgecss
90+
purgecss -c purgecss.config.js
91+
- name: Deploy 🚀
92+
if: github.event_name != 'pull_request'
93+
uses: JamesIves/github-pages-deploy-action@v4
94+
with:
95+
folder: _site

0 commit comments

Comments
 (0)