-
Notifications
You must be signed in to change notification settings - Fork 46
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
Learning path automation #432
Conversation
@lenucksi / @rrrutledge would either or both of you be able to review this please? |
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.
Very neat to see!
@@ -226,7 +226,7 @@ | |||
video: | |||
isc: https://innersourcecommons.org/learn/learning-path/contributor/02/ | |||
oreilly: https://learning.oreilly.com/learning-paths/learning-path-the/0636920338833/0636920338802-video329500 | |||
youtube: https://youtu.be/S0Gps2AbZ7M | |||
youtube: https://www.youtube.com/watch?v=S0Gps2AbZ7M |
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.
Just curious why this change?
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.
When this was updated in #431 it used the youtu.be
format, but the script expects www.youtube.com
format - all other YouTube URLS in this file are in that format. The script needs to extract the video ID from the URL.
- name: Checkout innersourcecommons.org | ||
uses: actions/checkout@v2 | ||
with: | ||
ssh-key: ${{ secrets.WEBSITE_DEPLOY_KEY }} |
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.
This is entered in by repo admins somewhere in the UI?
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.
Correct. @voborgus added the public key as a Deploy Key for https://github.com/InnerSourceCommons/innersourcecommons.org, and I added the private key to https://github.com/InnerSourceCommons/InnerSourceLearningPath as an Action secret.
npm ci | ||
TOKEN=${{ secrets.GITHUB_TOKEN }} node generate_learning_path_markdown.js | ||
cp -r newsite/. ../../innersourcecommons.org/content/learn/learning-path/ | ||
- name : Commit |
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.
Is there a way to open a PR or do we still have to do that manually?
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.
Maybe we should just list directly to main and skip the whole branch thing.
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.
Discussed in InnerSourceCommons/innersourcecommons.org#130, but to summarise:
- Deploy Keys do not have GitHub API access, so this Action cannot raise a PR. Instead, there is another Action on the innersourcecommons.org repo which raises a PR whenever the
publish-latest-learning-path
branch is pushed to (added in Learning path automation innersourcecommons.org#130). We considered alternatives to using a Deploy Key, but stuck with this solution. - Original plan was to push directly to main, but this would trigger a website rebuild into production and the preference was to have a manual step to reduce the risk of an outage of the website.
Along with InnerSourceCommons/innersourcecommons.org#130, this fixes #349.
This new GitHub Action will (if relevant files have changed on master):
publish-latest-learning-path
branch of innersourcecommons.orgpublish-latest-learning-path
branch of innersourcecommons.orgOpening a Pull Request will be done a separate action run on innersourcecommons.org repo, due to limitations of GitHub deploy keys (see InnerSourceCommons/innersourcecommons.org#130).
This has been tested against earlier commits, where the action was configured to build from this branch - https://github.com/InnerSourceCommons/InnerSourceLearningPath/actions/workflows/publish-to-website.yml - and the output used to open a PR updating the website - InnerSourceCommons/innersourcecommons.org#134.