From b3ee2d33ea57cab3b14cb279a7e1a344beebcb8b Mon Sep 17 00:00:00 2001 From: Ross Buggins Date: Wed, 5 Jun 2024 13:15:26 +0100 Subject: [PATCH 1/2] get artifacts --- .github/workflows/jekyll-gh-pages.yml | 35 +++++++++++++++++---------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml index 8312361..ef44524 100644 --- a/.github/workflows/jekyll-gh-pages.yml +++ b/.github/workflows/jekyll-gh-pages.yml @@ -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 @@ -70,13 +58,34 @@ 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: Download site artifacts + uses: actions/download-artifact@v4 + with: + name: site + - 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 From 0c44f569a8a1c9d38a36671a853095a6c3385ec1 Mon Sep 17 00:00:00 2001 From: Ross Buggins Date: Wed, 5 Jun 2024 13:40:21 +0100 Subject: [PATCH 2/2] test sonar cloud --- .github/workflows/jekyll-gh-pages.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml index ef44524..f0985b1 100644 --- a/.github/workflows/jekyll-gh-pages.yml +++ b/.github/workflows/jekyll-gh-pages.yml @@ -70,10 +70,15 @@ jobs: 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: