Skip to content

Commit b4ea665

Browse files
authored
Merge pull request #27 from FiQCI/update-ci
ci: optimize workflows with faster setup actions and separate CI/CD c…
2 parents 5c33776 + b8b6ca5 commit b4ea665

2 files changed

Lines changed: 56 additions & 9 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI - Build and test
2+
on:
3+
pull_request:
4+
branches: [ "rewrite/main" ]
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4.2.2
12+
13+
- name: Setup Ruby
14+
uses: ruby/setup-ruby@v1.253.0
15+
with:
16+
ruby-version: '3.3.5'
17+
bundler-cache: true
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4.4.0
21+
with:
22+
node-version: '22.10.0'
23+
cache: 'npm'
24+
25+
- name: Install Node.js packages
26+
run: npm ci
27+
28+
- name: Build stylesheets using Tailwind CSS
29+
run: npm run-script tailwindcss -- --minify
30+
31+
- name: Build React components using Webpack
32+
env:
33+
MATOMO_URL: mwa-acf.2.rahtiapp.fi
34+
MATOMO_TAG_MANAGER_CONTAINER: jyLY2YKH
35+
run: npm run-script webpack -- --mode=production
36+
37+
- name: Build site using Jekyll
38+
env:
39+
JEKYLL_ENV: production
40+
run: npm run-script jekyll:build
41+
42+
- name: Check build artifacts
43+
run: |
44+
ls -la dist/
45+
echo "Build completed successfully!"

.github/workflows/deployment.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Build and deploy site to GitHub Pages
22
on:
33
push:
44
branches: [ "rewrite/main" ]
5-
pull_request:
6-
branches: [ "rewrite/main" ]
75
workflow_dispatch:
86

97
jobs:
@@ -12,17 +10,21 @@ jobs:
1210

1311
steps:
1412
- uses: actions/checkout@v4.2.2
15-
with:
16-
ref: rewrite/main
1713

18-
- name: Install Ruby and Node.js using asdf
19-
uses: asdf-vm/actions/install@v3.0.2
14+
- name: Setup Ruby
15+
uses: ruby/setup-ruby@v1.253.0
16+
with:
17+
ruby-version: '3.3.5'
18+
bundler-cache: true
2019

21-
- name: Install Ruby gems
22-
run: bundle install
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4.4.0
22+
with:
23+
node-version: '22.10.0'
24+
cache: 'npm'
2325

2426
- name: Install Node.js packages
25-
run: npm install
27+
run: npm ci # clean install
2628

2729
- name: Build stylesheets using Tailwind CSS
2830
run: npm run-script tailwindcss -- --minify

0 commit comments

Comments
 (0)