1

I am trying to create a GitHub workflow that would essentially deploy multiple static websites to GH Pages. The sites would live in their own subfolders beneath the (website) root, and the catch is that they need to be deployed independent of one another.

For this to work I need to upload a new website build into its subfolder without changing the said folder's siblings. I'm using actions/[email protected] but have not found a way of doing this; github-pages environment is always cleared first and only the last thing I upload remains.

Is there a way to either do "partial writes" through a workflow into the github-pages environment, or, alternatively, can I download my current environment data, append files to it and then upload the whole thing? Or should I just back off and have my workflow manage the files in a branch?

1 Answer 1

0

If you are using GitHub addresses for the page, it naturally creates subfolders for additional repositories. You can only choose one repository to be the root.

Example

  • Repo: website <username>.github.io
  • Repo: blog <username>.github.io/blog
  • Repo: projects <username>.github.io/projects

And so on.

Custom domains

If you want to use custom domains, you would need to "front door" requests to map each subfolder as I don't think there is way to use the above set up with a custom domain.

Alternatively, you could push the files to a static site hosting location / file storage (i.e. Azure Static Site, Amazon S3, etc). Each push would overwrite files, but you may need a strategy to handle deletions as you're not clearing everything out on each publish.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.