lhcb / glossary

LHCb Glossary
https://lhcb.github.io/glossary
Creative Commons Attribution 4.0 International
11 stars 16 forks source link

Use GHAs rather than Travis #50

Closed eduardo-rodrigues closed 2 years ago

eduardo-rodrigues commented 2 years ago

Making use of the Action https://github.com/marketplace/actions/gitbook-action.

eduardo-rodrigues commented 2 years ago

Following up from https://github.com/lhcb/glossary/pull/49 - do you mean something like this, @henryiii? I now have to find a way to remore the required step for Travis above, which is an issue I did not get in the past ...

henryiii commented 2 years ago

Oh, wow, didn't know there was a gitbook action. Would have suggested a gitbook build + the common deploy action used. If this works, that will be really nice. You'll need to go to branches -> edit -> change the requirements, as well as there might be a button to turn on Actions.

henryiii commented 2 years ago

If you want to add me to this repo, I can help. But you can also do it if you want :)

eduardo-rodrigues commented 2 years ago

Oh, wow, didn't know there was a gitbook action. Would have suggested a gitbook build + the common deploy action used. If this works, that will be really nice.

Indeed. Would be nice. I did a search first since ready-to-use actions help enormously :-).

You'll need to go to branches -> edit -> change the requirements, as well as there might be a button to turn on Actions.

Dunno what you mean here, unfortunately. I looked around but found nothing like you say. But you are still owner I believe, so should be able to check around ... if I can still a bit of your time and help 👍 ... That would be very much appreciated.

henryiii commented 2 years ago

I did a search first since ready-to-use actions help enormously :-).

I still use gitbook with GitLab CI, and it's been a bit of a pain - as it ages out (since they moved to a closed-source model a couple of years ago), it's becoming harder to get it to build, more pinning and special versions needed. Having that in a centrally maintained action would be much nicer.

eduardo-rodrigues commented 2 years ago

Found what you meant :D. Disabled the requirement so now Travis is no longer required ... Now need to turn Actions on as nothing is running so far ...

henryiii commented 2 years ago

I think we'll need to merge to get actions to run, the action file needs to be on the default branch, IIRC.

henryiii commented 2 years ago

Also, I'd only publish on runs on master, and maybe just do a test build on PRs?

eduardo-rodrigues commented 2 years ago

I think we'll need to merge to get actions to run, the action file needs to be on the default branch, IIRC.

Makes sense, fair enough.

henryiii commented 2 years ago

Also, I'd only publish on runs on master, and maybe just do a test build on PRs?

Nevermind, this is almost what you are doing, just no builds at all on PRs. Which might be why this is not doing anything yet.

eduardo-rodrigues commented 2 years ago

Also, I'd only publish on runs on master, and maybe just do a test build on PRs?

What are you suggesting to change? A test on PRs sounds good.

Basically

on:
  pull_request:
  push:
    branches:
      - master  # trigger branch

?

henryiii commented 2 years ago

Except you don't want to publish if pull_request. Looking to see if the action has a way to specify that.

eduardo-rodrigues commented 2 years ago

Except you don't want to publish if pull_request. Looking to see if the action has a way to specify that.

Oops, you're of course right! Need to scope it for the build of the Gitbook ...

henryiii commented 2 years ago

Not sure how to disable the publish in this action. It has too much configuration. :) Though I guess you could publish to a test repo or a different branch, that might be interesting. You can add if: github.event_name == 'push' or pull_request I believe to filter.

eduardo-rodrigues commented 2 years ago

Not sure how to disable the publish in this action. It has too much configuration. :) Though I guess you could publish to a test repo or a different branch, that might be interesting. You can add if: github.event_name == 'push' or pull_request I believe to filter.

OK, trying that ... fingers crossed!

eduardo-rodrigues commented 2 years ago

OK, progressing. Now Actions run and I get

Run python3 .ci/prepare.py
python3: can't open file '.ci/prepare.py': [Errno 2] No such file or directory
Error: Process completed with exit code 2.
henryiii commented 2 years ago

You need to checkout before you run anything else that needs the checked out files.

henryiii commented 2 years ago

Seems to be working?

eduardo-rodrigues commented 2 years ago

Seems to be working?

Yep 🚀! The test branch got created with all stuff in 👍 !

eduardo-rodrigues commented 2 years ago

I'm going to merge and look at the actual deployment. Really nice the action. Thank you as ever for your help @henryiii 🥇 !