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

Add workflow for deploying to staging #11031

Merged

Conversation

Matt-Yorkley
Copy link
Contributor

@Matt-Yorkley Matt-Yorkley commented Jun 15, 2023

What? Why?

Adds a new workflow for deploying to staging servers via github actions.

What should we test?

The funny thing about workflows is you can't see if they work until after they're merged...

It should be possible to trigger a deployment by either:

  • adding the pr-staged-uk or pr-staged-fr or pr-staged-au label to a pull request
  • going into Actions then Workflows and selecting the workflow and then manually triggering a deployment (and it should let you choose a branch and a staging server)

Release notes

Changelog Category: Technical changes

The title of the pull request will be included in the release notes.

@Matt-Yorkley Matt-Yorkley self-assigned this Jun 15, 2023
@Matt-Yorkley Matt-Yorkley marked this pull request as ready for review June 15, 2023 19:40
@Matt-Yorkley Matt-Yorkley merged commit 5729e33 into openfoodfoundation:master Jun 15, 2023
50 of 51 checks passed
@Matt-Yorkley Matt-Yorkley added pr-staged-uk staging.openfoodnetwork.org.uk and removed pr-staged-uk staging.openfoodnetwork.org.uk labels Jun 15, 2023
Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

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

Very cool. Thank you.

@Matt-Yorkley Matt-Yorkley added pr-staged-uk staging.openfoodnetwork.org.uk and removed pr-staged-uk staging.openfoodnetwork.org.uk labels Jun 15, 2023
@jibees
Copy link
Contributor

jibees commented Jun 16, 2023

Do you know why I can't see the box with CI which should be at the bottom of a PR page ?
I can't see on this PR, and some others, as I can see it here : #10704

I mean this box:
Capture d’écran 2023-06-16 à 11 37 14

@Matt-Yorkley
Copy link
Contributor Author

That's pretty weird. It was there last night when I went to bed, and now it's gone. Maybe a temporary github glitch? 🤷‍♂️

@filipefurtad0
Copy link
Contributor

Could this be related? Should we empty our GH Actions cache?

image

@sigmundpetersen
Copy link
Contributor

I think it goes away when PR is merged, no?

@filipefurtad0
Copy link
Contributor

I think it goes away when PR is merged, no?

Yes, I think so @sigmundpetersen 👍

Thanks for this change @Matt-Yorkley 🙏

I'm playing around with the basic functionalities, some initial thoughts:

  • The label process is quite straightforward. But somehow is failing with:

ofn-deploy@staging.coopcircuits.fr: Permission denied (publickey).

Or for staging-UK, an example here:
https://github.com/openfoodfoundation/openfoodnetwork/actions/runs/5288835468/jobs/9571186050

  • And the manual process:

image

and it should let you choose a branch and a staging server

Worked nicely for master, which can be found under Branches 👍
We might need to adjust out release process, as I could not find a "build" for the different versions of master. But I think we can circumvent this by creating a "release branch" - something to discuss.

However, I think we're only able to select some branches - or am I looking in the wrong place? For example, I'm not finding a way to trigger a manual deploy on mkllnk:ruby3.1, other than the label process.

Also, we can see the Tags from previous releases, which is great 💪

@Matt-Yorkley
Copy link
Contributor Author

Matt-Yorkley commented Jun 16, 2023

Yeah the UX around Github Actions seems a bit clunky. And yes it's currently not working with the labelling thing, I need to tweak it a bit and figure out why. It seems like maybe it's ignoring the secrets in some cases and not others?

Also it looks like when manually triggering a deployment it only works if the branch you're choosing already contains the new workflow(?), which is a bit annoying. So it's currently present in master but it's not in last week's release, so I think we can't deploy last week's release to staging via the workflow, but maybe we can do it with the next release?

I'm not finding a way to trigger a manual deploy on mkllnk:ruby3.1, other than the label process

Yeah I think we'll want to deploy the merge commit for PRs in that case instead of the branch in the external repo (which should work with the labelling-trigger on pull requests, once they're fixed).

It's getting there but it's not finished yet 👍

@Matt-Yorkley Matt-Yorkley added pr-staged-uk staging.openfoodnetwork.org.uk and removed pr-staged-uk staging.openfoodnetwork.org.uk labels Jun 16, 2023
@filipefurtad0 filipefurtad0 removed the pr-staged-uk staging.openfoodnetwork.org.uk label Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants