Skip to content

Commit e0ef0a1

Browse files
committed
Reverted chatgpt
1 parent ec3cec0 commit e0ef0a1

File tree

1 file changed

+82
-25
lines changed

1 file changed

+82
-25
lines changed

.github/workflows/deploy.yml

+82-25
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
# This is the name of our workflow.
2+
# Github will show it on its Website UI
13
name: deploy
2-
4+
# This configures our workflow to be triggered
5+
# only when we push to the master branch
36
on:
47
push:
58
branches:
@@ -8,75 +11,129 @@ on:
811
types: [opened, synchronize, reopened, closed]
912
branches:
1013
- master
14+
1115
workflow_dispatch:
1216

1317
env:
1418
RUBY_VERSION: "3.3.2"
1519
BUNDLER_VERSION: "2.5.11"
1620

21+
# Here is where we define our jobs.
22+
# Which means the tasks we want Github to execute
1723
jobs:
1824
build:
19-
name: Build site
25+
name: build
26+
# Here we specify in whith OS we want it to run
2027
runs-on: ubuntu-latest
28+
# Now we define which actions will take place.
29+
# One after another
2130
steps:
22-
- name: Checkout repository
31+
# This is the first action. It will make sure that we have
32+
# all the necessary files from our repo, including our custom actions
33+
# This action here is actually from a remote repo available from Githup itself
34+
- name: 🛎 Checkout master
2335
uses: actions/checkout@v2
2436
with:
2537
fetch-depth: 1
26-
- name: Install dependencies
38+
- name: ⚡️ Install dependencies
2739
run: |
2840
sudo apt-get update
29-
sudo apt-get install -y --no-install-recommends bats build-essential ca-certificates curl make shellcheck libgsl-dev libffi-dev
41+
sudo apt-get install -y --no-install-recommends bats build-essential ca-certificates curl make shellcheck libgsl-dev libffi-dev minify liblapacke-dev libopenblas-dev
3042
sudo gem install bundler:${{ env.BUNDLER_VERSION }}
31-
- name: Set up Ruby
43+
- name: Setup Ruby
3244
uses: ruby/setup-ruby@v1
3345
with:
34-
ruby-version: ${{ env.RUBY_VERSION }}
35-
bundler-cache: true
36-
- name: Cache node modules
46+
ruby-version: ${{ env.RUBY_VERSION }} # Not needed with a .ruby-version file
47+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
48+
- name: ⚡️ Cache node modules
3749
uses: actions/cache@v3
50+
env:
51+
cache-name: cache-node-modules
3852
with:
53+
# npm cache files are stored in `~/.npm` on Linux/macOS
3954
path: ~/.npm
40-
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}
41-
- name: Install JS dependencies
42-
run: npm install
43-
- name: Check Jekyll configuration
55+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
56+
restore-keys: |
57+
${{ runner.os }}-build-${{ env.cache-name }}-
58+
${{ runner.os }}-build-
59+
${{ runner.os }}-
60+
- name: ⚡️ Setting up dependencies
61+
continue-on-error: true
62+
run: |
63+
npm install
64+
- name: Checking Jekyll configuration
4465
run: bundle exec jekyll doctor
45-
- name: Build site
46-
run: bundle exec jekyll build --lsi --profile
66+
- name: 🔨 Build site
67+
run: |
68+
bundle exec jekyll build --lsi --profile
4769
env:
4870
JEKYLL_ENV: production
49-
- name: Cache jekyll site
71+
#- name: Optimize
72+
# run: |
73+
# minify -r -o _site/ --html-keep-document-tags --html-keep-end-tags --html-keep-default-attrvals --html-keep-whitespace --verbose _site
74+
- name: Cache Jekyll site
5075
uses: actions/cache@v3
5176
with:
5277
path: "_site/"
5378
key: ${{ runner.os }}-${{ github.sha }}
54-
79+
# npm run build:js
80+
# - name: 🔨 Test calculations JS
81+
# run: |
82+
# npm run test
5583
deploy:
84+
if: github.event_name == 'push'
85+
name: deploy
5686
needs: build
5787
runs-on: ubuntu-latest
5888
steps:
59-
- name: Deploy to GitHub Pages
89+
- name: Use cache
90+
uses: actions/cache@v3
91+
with:
92+
path: "_site/"
93+
key: ${{ runner.os }}-${{ github.sha }}
94+
- name: 🎉 Deploy to GitHub Pages 🎊
95+
if: success()
6096
uses: crazy-max/ghaction-github-pages@v2
6197
with:
6298
target_branch: gh-pages
6399
build_dir: _site
64100
env:
65101
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66-
67102
test:
68103
needs: build
69104
runs-on: ubuntu-latest
70105
steps:
71-
- name: Check HTML with HTMLProofer
106+
- name: Use cache
107+
uses: actions/cache@v3
108+
with:
109+
path: "_site/"
110+
key: ${{ runner.os }}-${{ github.sha }}
111+
- name: ⚡️ Cache HTMLProofer
112+
id: cache-htmlproofer
113+
uses: actions/cache@v3
114+
with:
115+
path: tmp/.htmlproofer
116+
key: ${{ runner.os }}-htmlproofer
117+
- name: 📉 Check HTML
72118
uses: chabad360/htmlproofer@master
73119
with:
74-
directory: ./_site
75-
arguments: "--only-4xx --ignore-status-codes '400,403,409,429'"
76-
120+
directory: "./_site"
121+
# The directory to scan
122+
arguments: |
123+
--only-4xx
124+
--ignore-status-codes "400,403,409,429"
125+
--ignore-empty-alt
126+
--allow-hash-href
127+
--no-enforce-https
128+
--ignore-urls "/bjsm.bmj.com/, /mademistakes.com/, /www.t-nation.com/"
77129
clean:
78-
needs: build
130+
needs: [build,deploy,test]
79131
runs-on: ubuntu-latest
80132
steps:
81-
- name: Clean build artifacts
133+
- name: Use cache
134+
uses: actions/cache@v3
135+
with:
136+
path: "_site/"
137+
key: ${{ runner.os }}-${{ github.sha }}
138+
- name: ☁️ Cleaning up
82139
run: bundle exec jekyll clean

0 commit comments

Comments
 (0)