Skip to content

Commit 36c4e5d

Browse files
Merge pull request #32 from RossBugginsNHS/test-sonar
Sonar get built site artifacts for analysis as well as source.
2 parents cee1020 + 0c44f56 commit 36c4e5d

File tree

1 file changed

+27
-13
lines changed

1 file changed

+27
-13
lines changed

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

+27-13
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,6 @@ concurrency:
2727
cancel-in-progress: false
2828

2929
jobs:
30-
sonarcloud:
31-
name: SonarCloud
32-
runs-on: ubuntu-latest
33-
steps:
34-
- uses: actions/checkout@v3
35-
with:
36-
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
37-
- name: SonarCloud Scan
38-
uses: SonarSource/sonarcloud-github-action@master
39-
env:
40-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
41-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4230
# Build job
4331
build:
4432
runs-on: ubuntu-latest
@@ -70,13 +58,39 @@ jobs:
7058
with:
7159
path: "docs/_site/"
7260

61+
- name: Archive production artifacts
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: site
65+
path: "docs/_site/"
66+
67+
# Deployment job
68+
sonarcloud:
69+
name: SonarCloud
70+
runs-on: ubuntu-latest
71+
needs: build
72+
steps:
73+
- name: Checkout
74+
uses: actions/checkout@v4
75+
- name: Download site artifacts
76+
uses: actions/download-artifact@v4
77+
with:
78+
name: site
79+
path: _site
80+
- name: Display structure of downloaded files
81+
run: ls -R
82+
- name: SonarCloud Scan
83+
uses: SonarSource/sonarcloud-github-action@master
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
86+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
7387
# Deployment job
7488
deploy:
7589
environment:
7690
name: github-pages
7791
url: ${{ steps.deployment.outputs.page_url }}
7892
runs-on: ubuntu-latest
79-
needs: build
93+
needs: sonarcloud
8094
steps:
8195
- name: Deploy to GitHub Pages
8296
id: deployment

0 commit comments

Comments
 (0)