From 392122ae968b54458c6b7de746c3943e68504b7f Mon Sep 17 00:00:00 2001 From: Moiz Habibi Date: Mon, 25 Nov 2024 17:38:39 -0500 Subject: [PATCH] Publishing generated HTML aggregated Cucumber to GitHub Pages via GitHub Actions. --- .github/workflows/build.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c6831a012..87a393d13 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ on: type: string default: "dev" push: - branches: [ "dev" ] + branches: [ "474-publish-aggregated-cucumber-report" ] schedule: - cron: "0 6 * * *" # every day at 6am UTC @@ -96,6 +96,29 @@ jobs: uses: stCarolas/setup-maven@v5 with: maven-version: 3.9.9 + # Deploy aggregated Cucumber report to GitHub Pages + - name: Adding index.html file to aggregated cucumber report dir + run: | + touch index.html ./cucumber-report-aggregator/target/cucumber-reports/cucumber-html-reports + echo "Redirecting...

If you are not redirected automatically, click here.

" >> ./cucumber-report-aggregator/target/cucumber-reports/cucumber-html-reports/index.html + - name: Build static HTML + run: | + mkdir -p static-html + cp -R ./cucumber-report-aggregator/target/cucumber-reports/cucumber-html-reports + - name: Checkout GitHub Pages branch + uses: actions/checkout@v3 + with: + ref: gh-pages + fetch-depth: 0 + - name: Add Static HTML files to `gh-pages` branch + run: | + mkdir -p static-html + cp -R static-html/* ./static-html/ + git add static-html/ + git commit -m "Add/update static HTML content" || echo "No changes to commit" + - name: Push to GitHub Pages + run: | + git push origin gh-pages # Execute archetype tests - name: Run Archetype Tests run: |