Skip to content

Commit

Permalink
Merge pull request #32 from RossBugginsNHS/test-sonar
Browse files Browse the repository at this point in the history
Sonar get built site artifacts for analysis as well as source.
  • Loading branch information
RossBugginsNHS authored Jun 5, 2024
2 parents cee1020 + 0c44f56 commit 36c4e5d
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,6 @@ concurrency:
cancel-in-progress: false

jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# Build job
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -70,13 +58,39 @@ jobs:
with:
path: "docs/_site/"

- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: site
path: "docs/_site/"

# Deployment job
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download site artifacts
uses: actions/download-artifact@v4
with:
name: site
path: _site
- name: Display structure of downloaded files
run: ls -R
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
needs: sonarcloud
steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down

0 comments on commit 36c4e5d

Please sign in to comment.