Publish Webreport #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Webreport | |
on: | |
workflow_dispatch: | |
jobs: | |
runIt: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout default branch | |
uses: actions/checkout@v4.2.2 | |
with: | |
sparse-checkout: | | |
*.html | |
sparse-checkout-cone-mode: false | |
- name: Ensure only 1 html-file | |
run: | | |
htmlCount=$(find ./ -mindepth 1 -type f -name "*.html" -printf x | wc -c); | |
if [ "$htmlCount" -ne 1 ]; | |
then | |
echo "::error title=Too many html files::Found more than 1 html file. Webreport publishing aborted"; | |
exit 1; | |
fi | |
- name: Rename html-file to index.html | |
run: mv *.html index.html | |
- name: Copy html-file to gh-page branch | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./ | |
publish_branch: webreport-website |