Consistency juren trackerkit #195
Workflow file for this run
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: CI | |
on: | |
push: | |
pull_request: | |
env: | |
AWS_REGION: us-east-1 | |
AWS_RIS_PUB_BUCKET: smpte-ris-pub | |
AWS_RIS_PUB_ROLE: arn:aws:iam::189079736792:role/role-gh-ris-pub | |
AWS_OPENTRACKIO_BUCKET: opentrackio-www | |
AWS_OPENTRACKIO_ROLE: arn:aws:iam::189079736792:role/role-opentrackio-www | |
RIS_PUB_PREFIX: https://ris-pub.smpte.org | |
PYTHONPATH: src/main/python | |
jobs: | |
build: | |
if: > | |
github.repository_owner == 'SMPTE' && ( | |
(github.event_name == 'push' && github.ref == 'refs/heads/main') | |
|| github.event_name == 'pull_request' | |
|| github.event_name == 'release' | |
) | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pipenv | |
pipenv install --deploy --dev | |
- name: Setup build directory | |
run: mkdir -p build | |
- name: Unit tests | |
run: | | |
pipenv run python -m unittest discover -v -s src/test/python | |
- name: Generate opentrackio documentation | |
run: | | |
pipenv run python src/tools/python/make_opentrackio_documentation.py | |
- name: Generate parameter documentation | |
run: | | |
pipenv run python src/tools/python/make_documentation.py > build/index.md | |
- name: Generate HTML | |
uses: BaileyJM02/[email protected] | |
with: | |
input_path: build/index.md | |
output_dir: build/ | |
- name: Deploy to GitHub pages | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: build/ | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ env.AWS_RIS_PUB_ROLE }} | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Deploy to RIS pub | |
id: deployRISpub | |
shell: bash | |
run: | | |
SNAP_PATH=${GITHUB_REPOSITORY#*/}/${GITHUB_SHA} | |
aws s3 sync ./build/ s3://${{ env.AWS_RIS_PUB_BUCKET }}/${SNAP_PATH} | |
echo "SNAP_PATH=$SNAP_PATH" >> $GITHUB_OUTPUT | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ env.AWS_OPENTRACKIO_ROLE }} | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Deploy to www.opentrackio.org | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
shell: bash | |
run: | | |
aws s3 sync ./build/opentrackio s3://${{ env.AWS_OPENTRACKIO_BUCKET }} | |
- uses: marocchino/sticky-pull-request-comment@v2 | |
if: github.event_name == 'pull_request' | |
with: | |
message: | | |
[OpenTrackIO documentation](${{ env.RIS_PUB_PREFIX }}/${{ steps.deployRISpub.outputs.SNAP_PATH }}/opentrackio/) |