Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish GitHub Pages upon successfully-merged PR #252

Merged
merged 6 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,39 @@ 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: Checkout
uses: actions/checkout@v2
with:
submodules: true
path: monitoring

- name: Get uss_qualifier reports
uses: actions/download-artifact@v3
with:
name: monitoring-test-uss_qualifier-reports
path: ./artifacts

- 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/output/sequence_uspace ./public/artifacts/uss_qualifier/reports/sequence_uspace
cp -r ./artifacts/uss_qualifier/output/tested_requirements_uspace ./public/artifacts/uss_qualifier/reports/tested_requirements_uspace
cp -r ./artifacts/uss_qualifier/output/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)
2 changes: 1 addition & 1 deletion test/repo_hygiene/md_files/md_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ def check_md_file(md_file_path: str, repo_root: str) -> None:
def check_md_files(path: str, repo_root: str) -> None:
for md_file in glob.glob(os.path.join(path, "*.md")):
check_md_file(md_file, repo_root)
for subfolder in (f.path for f in os.scandir(path) if f.is_dir()):
for subfolder in (f.path for f in os.scandir(path) if f.is_dir() and f.name != "github_pages"):
check_md_files(subfolder, repo_root)
Loading