Skip to content

Commit

Permalink
Publish GitHub Pages upon successfully-merged PR
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminPelletier committed Oct 13, 2023
1 parent 1e42d08 commit 6cf2927
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,33 @@ jobs:
script: |
cd monitoring/prober
make test
publish-gh-pages:
name: Publish GitHub Pages
needs: [hygiene-tests, monitorlib-test, mock_uss-test, uss_qualifier-test, uss_qualifier_F3411-19-test, prober-test]
if: ${{ always() && contains(join(needs.*.result, ','), 'success') }}
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Get uss_qualifier reports
uses: actions/download-artifact@v3
with:
name: monitoring-test-uss_qualifier-reports
path: ./artifacts/uss_qualifier/reports

- name: Make site content
run: ./monitoring/github_pages/make_site_content.sh

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
enable_jekyll: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: ${{ github.event.head_commit.message }}
3 changes: 3 additions & 0 deletions github_pages/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# GitHub Pages tools

This folder contains tools to publish content to [this repository's GitHub Pages site](https://interuss.github.io/monitoring/). Publishing is performed by [the CI](../.github/workflows/ci.yml) at appropriate times, generally when a PR is merged to the main branch. Current site content is pushed to the gh-pages branch of this repository upon publishing, and then that content is deployed to the site by GitHub.
16 changes: 16 additions & 0 deletions github_pages/make_site_content.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

# This script generates the content for this repository's GitHub Pages site. It is invoked by the CI and expects the
# working folder to contain:
# ./monitoring: this repository
# ./artifacts/uss_qualifier/reports: Reports generated by from running uss_qualifier
#
# The content placed into ./public by this script will be published to the GitHub Pages site.

mkdir ./public
cp -r ./monitoring/github_pages/static/* ./public

mkdir -p ./public/artifacts/uss_qualifier/reports
cp -r ./artifacts/uss_qualifier/reports/sequence_uspace ./public/artifacts/uss_qualifier/reports/sequence_uspace
cp -r ./artifacts/uss_qualifier/reports/tested_requirements_uspace ./public/artifacts/uss_qualifier/reports/tested_requirements_uspace
cp -r ./artifacts/uss_qualifier/reports/capabilities_uspace.html ./public/artifacts/uss_qualifier/reports/capabilities_uspace.html
13 changes: 13 additions & 0 deletions github_pages/static/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# InterUSS [`monitoring`](https://github.com/interuss/monitoring) generated content

This site contains content automatically generated by actions in the [InterUSS](https://interussplatform.org) [monitoring repository](https://github.com/interuss/monitoring).

## uss_qualifier [reports](https://github.com/interuss/monitoring/tree/main/monitoring/uss_qualifier/reports)

These reports were generated during continuous integration for the most recent PR merged to the main branch.

### [U-space developer](https://github.com/interuss/monitoring/blob/main/monitoring/uss_qualifier/configurations/dev/uspace.yaml) [test configuration](https://github.com/interuss/monitoring/tree/main/monitoring/uss_qualifier/configurations)

* [Sequence view](./artifacts/uss_qualifier/reports/sequence_uspace)
* [Tested requirements](./artifacts/uss_qualifier/tested_requirements_uspace)
* [Demonstrated capabilities](./artifacts/uss_qualifier/capabilities_uspace.html)

0 comments on commit 6cf2927

Please sign in to comment.