Github action deploy development branch to subdir of master bracnh
Asked Answered
S

1

2

I have my github pages linked to the root of my master branch. I would like to have a github action create a subfolder off of that say dev/ and have that show my development branch. Without getting recursive headaches is this even possible? Github actions seem to work, i've been able to use checkoutv3 but that means changes are made on my development branch. How do I effectively copy between branches? This is just to get pages to work, I may have to rethink my git strategy?

Slung answered 4/7, 2022 at 13:15 Comment(1)
All GitHub Actions work in a clone of the original repository (the original remains unchanged in its usual place over on GitHub). Anything you do in this clone therefore does not affect the original, unless you use git push to send new commits from the new clone back to the original. Note that this will often require a non-single-branch, less-shallow (or perhaps even full) clone.Anyplace
C
1

Considering that "GitHub Pages now uses Actions by default" (Aug. 10), check if one of the starter workflow for GitHub Pages publication can work for you using the branch you want directly.

You can adapt those yml workflow files to reference the right branch, without having to copy from one to another.

The blog post adds:

Since inception, GitHub Pages have been scoped to a branch (and, optionally a /docs folder) in your repository.
Individual commits on the target branch would trigger builds followed by a deployment and branch protection rules have been the security mechanism for limiting deployments.

With the shift to GitHub Actions, GitHub Pages are now tracking deployments instead of builds.

A source branch is not required anymore and is at the discretion of a workflow’s triggers.
We’ve made it so a deployment must happen in the context of an environment (github-pages by default).
As a result, environment protection rules are the new security mechanism for limiting deployments.

https://static.mcmap.net/file/mcmap/ZG-AbGLDKwfpLC21bC2jaRA/user-images.githubusercontent.com/14911070/178842638-51b834d3-6c54-423e-95fa-822f734fa98a.png?ssl=1

Clifton answered 10/8, 2022 at 19:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.