-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Jekyll build/deploy workflow #86
base: master
Are you sure you want to change the base?
Conversation
I'm not actually sure what the best method for testing GitHub actions/workflows is without just deploying to prod.. I found one project claiming to be able to: But in attempting to run it in dryrun mode, it looked like it would fail:
I expect if we used an exact version tag it would probably work.. but that seems at odds with how other examples seem to imply GitHub works? Changing
Yet when we run it properly, we hit an issue based on the docker image that is being used not matching perfectly to how GitHub actions runners are:
So it seems we may not actually have a good way to be able to test this locally.. |
The build failed since the runner doesn't have the appropriate
Apparently we can install ubuntu packages as part of the workflow though, so if we install the gsl libraries, this probably should work:
|
This build shows that installing the We also need to consider the install order, so that
The
As currently setup, even using
To fix the follow warning, we need to set the appropriate environment variables for the Jekyll GitHub Metadata plugin:
Can we use |
Even when we removed Unsure if this is because Also, by using the cached gems, rather than having to re-install them, our total site dependencies/build step went from ~4min 51sec down to just ~16sec. |
Even when we removed Unsure if this is because |
Even when we removed Jekyll's So maybe In light of this.. i'm thinking we can leave the This also most likely renders #83 as irrelevant (Edit: as was pointed out on #83, I may have disabled |
f7406f5
to
e05b0b2
Compare
The build using
This appears to be caused by
This same env var will also be used by the Looking at the token I currently use for this on my local machine, it seems to only have the So perhaps creating a similar token, and configuring it as a GitHub Action secret that we then pass to this env var would work:
eg. Edit: Thoughts from 2023 now that I know more about GitHub actions.. is there any reason why I can't just use the action token for this? |
When we added the deploy step to a test branch, the build seemed to complete successfully, taking only ~6sec to deploy to the test gh-pages branch. The commit message was just
There appear to be some actions related to getting the current time, unsure if there is a simpler way:
Since most of these just seem to use
Maybe something like: - id: currentdate
name: Get the current date and export it for later steps to use
run: echo "::set-output name=date_str::$(date)"
#run: echo "::set-output name=date_str::`date`" |
The build testing whether we can get a formatted date as step output (without using external actions) seemed to work: - id: currentdate
name: 📅 get current date and time
run: echo "::set-output name=date_str::$(date)"
- name: 📅 check if date output was set correctly
run: echo ${{steps.currentdate.outputs.date_str}} Therefore, we can use them to customise the commit message for the generated site builds as per #86 (comment):
I think we want to use something like |
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.
Changes required before this PR can be merged.
push: | ||
branches: | ||
- master | ||
- jekyll-build-deploy-workflow |
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 needs to be removed before this PR is merged, and/or a better solution for testing in non-master PR's implemented (that won't override our production site deployment)
- jekyll-build-deploy-workflow | ||
paths-ignore: | ||
- .cache/** | ||
# - .github/** |
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.
uncomment this?
- name: 🔨 install system dependencies | ||
run: sudo apt-get install libgsl-dev |
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 can be cleaned up as part of #87
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.
uses: limjh16/jekyll-action-ts@v2 | ||
with: | ||
enable_cache: true | ||
# format_output: true |
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.
Do we want to enable this? Otherwise, remove it.
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./_site | ||
publish_branch: jekyll-build-deploy-workflow-gh-pages |
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 needs to be changed to the proper gh-pages
branch before this PR is merged, and/or a better solution for testing in non-master PR's implemented (that won't override our production site deployment)
Sets up a GitHub actions/workflow to build and deploy the Jekyll site to Github Pages.