Deploy greenness reports to GitHub pages #2
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: Deploy greenness reports to GitHub pages | |
on: | |
push: | |
branches: | |
- 'main' | |
paths: | |
- 'reports/greenness_reports/' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Generate directory index using tree | |
run: | | |
# Tree is installed by default on gh runners | |
cd reports/greenness_reports/ | |
tree -H '.' \ | |
--noreport \ | |
--dirsfirst \ | |
-T "Buildfarm Greenness Reports" \ | |
-P "*.html" \ | |
-o index.html | |
- uses: actions/configure-pages@v5 | |
- uses: actions/upload-pages-artifact@v3 | |
with: | |
path: 'reports/greenness_reports/' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |