Skip to content

Commit 18435e4

Browse files
Added support for node and npm in Jekyll build pipeline. Added SonarCloud (#33)
1 parent 74dc066 commit 18435e4

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

.github/workflows/jekyll-gh-pages.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ jobs:
3636
steps:
3737
- name: Checkout
3838
uses: actions/checkout@v4
39+
- uses: actions/setup-node@v4
40+
with:
41+
node-version: 18
42+
- run: npm ci
3943
- name: Setup Ruby
4044
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0
4145
with:
@@ -57,8 +61,33 @@ jobs:
5761
uses: actions/upload-pages-artifact@v3
5862
with:
5963
path: "docs/_site/"
64+
- name: Archive production artifacts
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: site
68+
path: "docs/_site/"
69+
70+
sonarcloud:
71+
name: SonarCloud
72+
runs-on: ubuntu-latest
73+
needs: build
74+
steps:
75+
- name: Checkout
76+
uses: actions/checkout@v4
77+
- name: Download site artifacts
78+
uses: actions/download-artifact@v4
79+
with:
80+
name: site
81+
path: _site
82+
- name: Display structure of downloaded files
83+
run: ls -R
84+
- name: SonarCloud Scan
85+
uses: SonarSource/sonarcloud-github-action@master
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
88+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
6089

61-
# Deployment job
90+
# Deployment job
6291
deploy:
6392
environment:
6493
name: github-pages

sonar-project.properties

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
sonar.projectKey=NHSDigital_nhs-notify-web-cms
2+
sonar.organization=nhsdigital
3+
4+
# This is the name and version displayed in the SonarCloud UI.
5+
#sonar.projectName=nhs-notify
6+
#sonar.projectVersion=1.0
7+
8+
9+
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
10+
#sonar.sources=.
11+
12+
# Encoding of the source code. Default is default system encoding
13+
#sonar.sourceEncoding=UTF-8

0 commit comments

Comments
 (0)