Skip to content

Commit 754e370

Browse files
committed
Fuse test and build jobs into single workflow
1 parent 24e3e4c commit 754e370

1 file changed

Lines changed: 8 additions & 20 deletions

File tree

.github/workflows/jekyll.yml

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ concurrency:
3131
cancel-in-progress: false
3232

3333
jobs:
34-
# Test job
35-
test:
36-
if: github.event_name == 'pull_request'
34+
# Combined test and build job
35+
test-and-build:
3736
runs-on: ubuntu-latest
3837
steps:
3938
- name: Checkout
@@ -48,7 +47,7 @@ jobs:
4847
run: bundle install
4948
- name: Check for syntax errors
5049
run: bundle exec jekyll doctor
51-
- name: Build Jekyll site
50+
- name: Build Jekyll site for testing
5251
run: bundle exec jekyll build --strict_front_matter
5352
env:
5453
JEKYLL_ENV: development
@@ -64,28 +63,17 @@ jobs:
6463
run: |
6564
gem install html-proofer
6665
htmlproofer ./_site --external_only --check-external-hash
67-
68-
# Build job
69-
build:
70-
if: github.event_name == 'push'
71-
runs-on: ubuntu-latest
72-
steps:
73-
- name: Checkout
74-
uses: actions/checkout@v4
75-
- name: Setup Ruby
76-
uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4
77-
with:
78-
ruby-version: '3.3'
79-
bundler-cache: true
80-
cache-version: 0
8166
- name: Setup Pages
67+
if: github.event_name == 'push'
8268
id: pages
8369
uses: actions/configure-pages@v5
84-
- name: Build with Jekyll
70+
- name: Build with Jekyll for production
71+
if: github.event_name == 'push'
8572
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
8673
env:
8774
JEKYLL_ENV: production
8875
- name: Upload artifact
76+
if: github.event_name == 'push'
8977
uses: actions/upload-pages-artifact@v4
9078

9179
# Deployment job
@@ -95,7 +83,7 @@ jobs:
9583
name: github-pages
9684
url: ${{ steps.deployment.outputs.page_url }}
9785
runs-on: ubuntu-latest
98-
needs: build
86+
needs: test-and-build
9987
steps:
10088
- name: Deploy to GitHub Pages
10189
id: deployment

0 commit comments

Comments
 (0)