-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Automatically change Pages and Registry URL in gh-pages branch #101
Open
georgiastuart
wants to merge
6
commits into
singularityhub:main
Choose a base branch
from
georgiastuart:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8cca90b
Update to programatically change baseurl
georgiastuart eaf04f3
Merge pull request #1 from georgiastuart/change-base-url
georgiastuart f827634
Trigger workflow
georgiastuart 5df2603
Debug print
georgiastuart 6866beb
Remove extra quote
georgiastuart d8c1ac9
Automatically update URL
georgiastuart File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,18 +20,35 @@ jobs: | |
- name: Create conda environment | ||
run: conda create --quiet -c conda-forge --name shpc spython | ||
|
||
- name: Check out main | ||
uses: "actions/checkout@v3" | ||
with: | ||
ref: "main" | ||
path: "tmp-registry" | ||
|
||
- name: Install shpc | ||
run: | | ||
export PATH="/usr/share/miniconda/bin:$PATH" | ||
source activate shpc | ||
pip install git+https://github.com/singularityhub/singularity-hpc@main | ||
git clone https://github.com/singularityhub/shpc-registry /tmp/registry | ||
|
||
- name: Set Pages base URL and Registry URL | ||
run: | | ||
URL=$(curl -L \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer ${{ github.token }}"\ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
https://api.github.com/repos/${{ github.repository }}/pages \ | ||
| jq -r '.html_url') | ||
sed -i "s|/shpc-registry|$URL|" _config.yml | ||
sed -i "s|singularityhub/shpc-registry|${{ github.repository }}|" generate.sh | ||
|
||
- name: Generate docs | ||
run: | | ||
export PATH="/usr/share/miniconda/bin:$PATH" | ||
source activate shpc | ||
/bin/bash generate.sh /tmp/registry | ||
/bin/bash generate.sh ./tmp-registry | ||
rm -r tmp-registry | ||
|
||
- name: Deploy 🚀 | ||
uses: JamesIves/[email protected] | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is some risk here of running this regularly (and having the API response not return successfully, etc.) I want to suggest we add this instruction to the tutorial, to be done once, and it's OK if it's automated like this, or just a manual instruction.