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

Update to use GitHub Actions for CI #4125

Merged
merged 8 commits into from
Jun 26, 2020

Conversation

owenvoke
Copy link
Member

@owenvoke owenvoke commented Jun 24, 2020

We need to add the website's deploy key to the GitHub Action secrets. @agnivade, it looks like you added that deploy key, do you happen to still have it? If not, I guess we can add a new one? 🤔

Once we've added the deploy key there with a key of DEPLOY_KEY, then this should all (🤞) work as expected.


One other thing we need to remember to do (if this gets merged) is to remote the Travis CI required status check in the protected branch settings.

Closes #4097

@owenvoke owenvoke added the tooling Helper tools, scripts and automated processes. label Jun 24, 2020
@zlatanvasovic
Copy link
Contributor

One other thing we need to remember to do (if this gets merged) is to remote the Travis CI required status check in the protected branch settings.

Did you mean remove?

Also, I think it'd be the best to just generate a new deploy key.

@agnivade
Copy link
Member

I don't remember very clearly now, but there is nothing I have for a deploy key. All that I have is a personal access token for tldr-bot which is used to comment on PRs. I think we can just generate a new key for this one.

@owenvoke
Copy link
Member Author

Great, I'll set up a new key later today. 👍

@owenvoke
Copy link
Member Author

Deploy key added, all good to go. 🤞 Can anyone see any issues with this?

@owenvoke owenvoke marked this pull request as ready for review June 26, 2020 07:58
Copy link
Member

@sbrl sbrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok to me!

@mebeim said in Gitter:

I'll check this evening
Please don't merge before then

Copy link
Member

@mebeim mebeim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to go AFAICT. Nice job @owenvoke!

I'm curious about how you found out that github.event.number contains the PR number, it took me quite a while to check if that was correct since I've never used GH Actions before and I couldn't find it in the reference. Did you already know about it?

Anyway, merging this, let's see 🤞

@mebeim mebeim merged commit 68f8e47 into tldr-pages:master Jun 26, 2020
@zlatanvasovic
Copy link
Contributor

Works so far 😄

@mebeim
Copy link
Member

mebeim commented Jun 26, 2020

Okay, so it seems to work fine, except that looks like the "Deploy" step is being skipped (see log here):

screenshot

I am not sure why this happens since the check looked ok:

if: github.repository == 'tldr-pages/tldr' && github.branch == 'master'

@owenvoke any clue why?

@zlatanvasovic
Copy link
Contributor

zlatanvasovic commented Jun 26, 2020

@mebeim It should be github.ref instead of github.branch (https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions), that's why. I tried to fix it in d8e6c7e, but it doesn't work: https://github.com/tldr-pages/tldr/runs/811991894. :/

@mebeim
Copy link
Member

mebeim commented Jun 26, 2020

@zdroid no, github.ref is not the branch name, it's the complete REF, for example refs/pull/1234/merge for PR 1234. Please do not push to master directly!

@zlatanvasovic
Copy link
Contributor

zlatanvasovic commented Jun 26, 2020

This is what the reference says:

github.ref | string | The branch or tag ref that triggered the workflow run.

(It doesn't mention github.branch at all)

Yeah, my mistake, I'm sorry for that. I got used to GitHub automatically making a new branch when I edit some file.

@mebeim
Copy link
Member

mebeim commented Jun 26, 2020

@zdroid you're right. It does not mention branch. I wonder where we could get that information from. It almost looks like there's no good way of doing it other than parsing the ref manually, though I'm not 100% sure. That's annoying because it probably means the check should be done inside the script itself.

I guess we could be better off creating two separate workflows, one for testing and one for deployment, since you can specify the branch name in the .yml.

@owenvoke owenvoke deleted the feature/gh-actions branch June 26, 2020 17:32
@owenvoke
Copy link
Member Author

owenvoke commented Jun 26, 2020

Ah, I could have sworn there was a github.branch reference. 🤔

I guess splitting would be fine. 👍 Or could we use github.ref == 'refs/heads/master'?

@mebeim
Copy link
Member

mebeim commented Jun 26, 2020

@owenvoke hmm, are we sure it's always going to be refs/heads/master though? If so, then I think it's fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling Helper tools, scripts and automated processes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider moving to GitHub Actions
5 participants