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

Upload artifact #1300

Merged
merged 9 commits into from
Jun 26, 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
26 changes: 18 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ on:
type: boolean
required: true
default: false
upload:
description: 'Upload documentation (pdfs in _static/)'
type: boolean
required: true
default: false

defaults:
run:
Expand Down Expand Up @@ -70,30 +75,35 @@ jobs:

- name: Generate build files
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
GH_TOKEN: ${{ (env.python_version == env.python_deploy_version && (github.event.inputs.deploy || github.event.inputs.upload)) && secrets.GITHUB_TOKEN || 'NONE' }}
run: |
make prepare

- name: Build Impatient Guide
run: |
make impatient-guide
ls -lAFgh build/impatient-guide/build/html/index.html
mkdir -p build/deploy
mv build/impatient-guide/build/html build/deploy/impatient
ls -lAFgh build/impatient-guide/build/latex/NXImpatient.pdf
mkdir -p build/html
mv build/impatient-guide/build/html build/html/impatient

- name: Build User Manual
run: |
make pdf
make html
ls -lAFgh build/manual/build/html/index.html
mkdir -p build/deploy
mv build/manual/build/html/* build/deploy
ls -lAFgh build/manual/build/latex/nexus.pdf
mkdir -p build/html
mv build/manual/build/html/* build/html

- name: Deploy both the User Manual and the Impatient Guide
if: ${{ github.event.inputs.deploy && env.python_version == env.python_deploy_version }}
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
folder: build/deploy
folder: build/html

- name: Upload the User Manual and the Impatient Guide
if: ${{ github.event.inputs.upload && env.python_version == env.python_deploy_version }}
uses: actions/upload-artifact@v3
with:
name: nexus-definitions-docs
path: build/html
6 changes: 4 additions & 2 deletions dev_tools/utils/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ def get_file_contributors_via_api(repo_name, file_path):
returns a sorted dict of unique contributors to a file, or None if no GH_TOKEN has been defined in os.environ
"""
have_token = False
if "GH_TOKEN" in os.environ.keys():
access_token = os.environ["GH_TOKEN"]
access_token = os.getenv("GH_TOKEN")
if (
access_token is not None and access_token != "NONE"
): # latter clause is false in most CI cases
if len(access_token) > 0:
have_token = True
else:
Expand Down