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

DOC/CI: Fix automatic website deployments #366

Open
bocklund opened this issue Aug 9, 2021 · 5 comments
Open

DOC/CI: Fix automatic website deployments #366

bocklund opened this issue Aug 9, 2021 · 5 comments

Comments

@bocklund
Copy link
Collaborator

bocklund commented Aug 9, 2021

We were using TravisCI to deploy the website from our website branch to our AWS bucket, but TravisCI is no longer building on the dot-org domain and our docs aren't getting deployed anymore.

We should switch over the deployment script to GitHub Actions. AWS has an Action to configure the credentials with some Usage instructions to deploy to an S3 bucket.

@richardotis
Copy link
Collaborator

richardotis commented Sep 25, 2021

Fixed by 87b58fd
I also turned the Travis integration off for the pycalphad organization. It's suspended so it can be turned back on quickly if needed, but after a few days I'll probably remove it permanently. I also took the liberty of disabling some stale third-party integrations (which can also be turned back on if needed).

@richardotis
Copy link
Collaborator

richardotis commented Sep 25, 2021

An important aspect of the aws sync command is that it decides if a file is new by comparing timestamps. In a CI environment all the files in the website branch always have fresh timestamps, so they will all be uploaded, every commit. It's not a huge deal, but it's a little wasteful. Solutions are:

  1. Add the --size-only argument, which switches it to compare file sizes instead. It solves the problem but now you risk failing to upload a change (!), if the file size was somehow unchanged. Unfortunately hash-based comparison is not supported.
  2. Modify the arguments to only sync docs/latest instead of the entire docs directory
  3. Some sort of trickery with git diff to enumerate the changed files. I can imagine edge cases which could also lead to upload failures / un-synced files.
  4. Do nothing, bandwidth is cheap.

My current thinking is Option 2 is probably the way to go, as it's basically the same behavior as the Travis-based approach. If we need to sync other directories, it'd be pretty easy to make further changes.

@bocklund
Copy link
Collaborator Author

bocklund commented Oct 5, 2021

Option 2 sounds fine to me. Right we haven't been building tagged versions for awhile anyway. We could set up another action that is triggered on tags to build, commit, and upload a docs/<tag> directory.

@richardotis
Copy link
Collaborator

The changes I implemented haven't actually been working: https://github.community/t/push-from-action-does-not-trigger-subsequent-action/16854/5
I didn't notice at first because I set everything up with manual pushes, which still work (and I just triggered to ensure the latest examples are updated). This may be a good jumping off point to move forward (per our offline discussion) on splitting the website off into a separate repo, and maybe a move to an actual CMS or static-site generator.

@bocklund bocklund changed the title DOC/CI: Deploy documentation using GitHub Actions instead of TravisCI DOC/CI: Fix automatic website deployments Jun 23, 2022
@bocklund
Copy link
Collaborator Author

Can be triggered by pushing an empty commit to the website branch:

git commit --allow-empty -m "Bump website to trigger deployment"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants