product-os / flowzone

Reusable, opinionated, zero-conf workflows for GitHub actions
https://flowzone.pages.dev
Apache License 2.0
15 stars 5 forks source link

Add support for deploying to static web pages #127

Open klutchell opened 2 years ago

klutchell commented 2 years ago

We need something in the root to trigger this action, but it would be pretty straightforward.

https://github.com/balenaltd/handbook/blob/88f3c065952f6e43da1ac223d1cfdcf2da37c9dd/.github/workflows/deploy.yml#L26-L40

klutchell commented 2 years ago

Potentially solved with https://github.com/product-os/flowzone/issues/61

klutchell commented 2 years ago

There is a workaround now to use composite actions like we did with the handbook.

klutchell commented 2 years ago

Unclear if we need this or not. Keep this issue open for tracking request.

anujdeshpande commented 2 years ago

@klutchell I am not very sure that github pages is the best option out of all the static site hosting alternatives we have. There was an attempt at a group effort to find the best alternative to Netlify for Landr and this discussion is similar.

I think that Cloudflare Pages is a much more feature complete alternative to Netlify - and will fit quite well into our GH actions approach as well

Related improvement - thread attached to the pattern above has some discussion with Phil on this. We are having a call on Tuesday to chat more. Should I pull you in as well?

klutchell commented 2 years ago

Should I pull you in as well?

@anujdeshpande I can try to make it but I don't think I'm required. I only opened this as a reminder that we may want to explore additional deployment options, but I think the best way forward is to use the custom publish actions for now until we see a need to add features to FZ.

klutchell commented 2 years ago

Alternatives are being evaluated here: https://docs.google.com/document/d/19QIAhIwY_q1JV1nM7xflleFca2jmofxp-7fT0JImv5o

anujdeshpande commented 2 years ago

We decided to go ahead with Cloudflare Pages. I have their github action working on a personal repo. It needs some additional tokens that we will have to add as part of flowzone setup - but otherwise the experience was pretty straight forward today.

I will add instructions and open a PR for this soon

anujdeshpande commented 2 years ago

Note that these project types are not mutually exclusive, and your project may execute one or more of the following.

I love this line from the README and I think we should have website as a project type along with all these others. This will help us identify the repos that are also building documentation or other sites along with hosting source code.

The cloudflare action that I am working on will then look for that first and then run whatever is required

anujdeshpande commented 2 years ago

One way to implement a website project type would be to have a website.yml. This will indicate 2 things

  1. We expect flowzone to build and deploy this repo as a website
  2. The CF pages project name for this repo (which is required by it's action when deploying)

A third optional (we'd have to define a sensible default to keep it optional) argument could be