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

Learning path automation #432

Merged
merged 4 commits into from
Jul 19, 2021
Merged

Learning path automation #432

merged 4 commits into from
Jul 19, 2021

Conversation

tsadler1988
Copy link
Collaborator

@tsadler1988 tsadler1988 commented Jul 6, 2021

Along with InnerSourceCommons/innersourcecommons.org#130, this fixes #349.

This new GitHub Action will (if relevant files have changed on master):

  • Checkout LearningPath and innersourcecommons.org repos
  • Checkout or create a publish-latest-learning-path branch of innersourcecommons.org
  • Run the scripts to generate website markdown from learning path articles and data
  • Commit and push to the publish-latest-learning-path branch of innersourcecommons.org

Opening 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.

@tsadler1988
Copy link
Collaborator Author

@lenucksi / @rrrutledge would either or both of you be able to review this please?

Copy link
Contributor

@rrrutledge rrrutledge left a 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
Copy link
Contributor

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?

Copy link
Collaborator Author

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 }}
Copy link
Contributor

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?

Copy link
Collaborator Author

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
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Collaborator Author

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.

@tsadler1988 tsadler1988 merged commit 38ebe50 into master Jul 19, 2021
Learning Path Segments automation moved this from In Review to Done Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

Automate publishing to innersourcecommons.org
3 participants