Skip to content

chore: gh-pages does not exist message for doc-deploy-dev - #475

Merged
klmcadams merged 23 commits into
mainfrom
maint/check-gh-pages
May 7, 2024
Merged

klmcadams merged 23 commits into
mainfrom
maint/check-gh-pages

Conversation

@klmcadams

@klmcadams klmcadams commented Apr 29, 2024 •

Copy link
Copy Markdown
Contributor

Create branch if it doesn't exist in doc-deploy-dev and doc-deploy-stable

Create new gh-pages branch: CI · ansys-internal/pytemplate-sandbox@cc726c4 (github.com)
Update existing gh-pages branch: CI · ansys-internal/pytemplate-sandbox@cc726c4 (github.com)

Create new unique branch: specify branch · ansys-internal/pytemplate-sandbox@eb14ba3 (github.com)
Update existing unique branch: CI · ansys-internal/pytemplate-sandbox@eb14ba3 (github.com)

@klmcadams
klmcadams requested a review from a team as a code owner April 29, 2024 16:43
@ansys-reviewer-bot

Copy link
Copy Markdown
Contributor

Thanks for opening a Pull Request. If you want to perform a review write a comment saying:

@ansys-reviewer-bot review

@github-actions github-actions Bot added the maintenance Generic maintenance related label Apr 29, 2024
@RobPasMue

Copy link
Copy Markdown
Member

Can we not just fix this in the doc-deploy-* actions? I'd prefer fixing it rather than just informing

@SMoraisAnsys

Copy link
Copy Markdown
Contributor

Can we not just fix this in the doc-deploy-* actions? I'd prefer fixing it rather than just informing

Agreeing with @RobPasMue, it would be great for new maintainers trying to use ansys actions.

@jorgepiloto

Copy link
Copy Markdown
Member

It would be great if we could check if the input branch exists in the origin. If not, the script creates and pushes it before uploading the content.

Comment thread doc-deploy-dev/action.yml Resolved
Comment thread doc-deploy-dev/action.yml Resolved
Comment thread doc-deploy-stable/action.yml Resolved
Comment thread doc-deploy-dev/action.yml Resolved
Comment thread doc-deploy-dev/action.yml Resolved
Comment thread doc-deploy-dev/action.yml Resolved
@SMoraisAnsys

Copy link
Copy Markdown
Contributor

Just wondering if handling non existing branch creation couldn't be performer more simply. Would it be possible to follow the following workflow :

  1. create the branch locally (git checkout --orphan ${{ env.BRANCH }})
  2. configure git (since it seems to be required)
  3. push without commit (git push origin ${{ env.BRANCH }}:${{ env.BRANCH }})

If the branch exists, could a simple git switch ${{ env.BRANCH }} do the trick ?

@klmcadams

Copy link
Copy Markdown
Contributor Author

Hi @SMoraisAnsys, I tried following those steps only but ran into a few issues:

  • When trying to push without commit I got this error: "error: src refspec gh-pages does not match any. "
    • When I looked up how to solve this issue, it said to add a commit and then push
  • It wasn't able to switch to the existing gh-pages branch bc I got this error: "fatal: invalid reference: gh-pages"
    • I looked it up and it said to do a fetch, so I added that command before switch
  • Without git rm --cached -r . and git clean -fd, extra files are added to the gh-pages branch even though we are doing an orphan checkout (see pic below)

noclean

@SMoraisAnsys

Copy link
Copy Markdown
Contributor

Hi @SMoraisAnsys, I tried following those steps only but ran into a few issues:

  • When trying to push without commit I got this error: "error: src refspec gh-pages does not match any. "

    • When I looked up how to solve this issue, it said to add a commit and then push
  • It wasn't able to switch to the existing gh-pages branch bc I got this error: "fatal: invalid reference: gh-pages"

    • I looked it up and it said to do a fetch, so I added that command before switch
  • Without git rm --cached -r . and git clean -fd, extra files are added to the gh-pages branch even though we are doing an orphan checkout (see pic below)

noclean

Thanks for trying the suggestion and letting me know of the associated limitations !

@SMoraisAnsys

Copy link
Copy Markdown
Contributor

Hi @SMoraisAnsys, I tried following those steps only but ran into a few issues:

  • When trying to push without commit I got this error: "error: src refspec gh-pages does not match any. "

    • When I looked up how to solve this issue, it said to add a commit and then push
  • It wasn't able to switch to the existing gh-pages branch bc I got this error: "fatal: invalid reference: gh-pages"

    • I looked it up and it said to do a fetch, so I added that command before switch
  • Without git rm --cached -r . and git clean -fd, extra files are added to the gh-pages branch even though we are doing an orphan checkout (see pic below)

noclean

Thanks for trying the suggestion and letting me know of the associated limitations !

Just a though but it makes sense that it doesn't work without commiting. AFAIK, branch are references to commits. Thus it would be strange to being able to publish an orphan branch without commiting first. Should have though about that before...

@RobPasMue

Copy link
Copy Markdown
Member

Let's try and get this merged

@klmcadams
klmcadams requested review from RobPasMue and jorgepiloto May 6, 2024 14:40
@klmcadams
klmcadams enabled auto-merge (squash) May 6, 2024 15:09
@RobPasMue

Copy link
Copy Markdown
Member

@jorgepiloto - please approve whenever you get the chance. I believe your suggestions were addressed

@SMoraisAnsys SMoraisAnsys left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks again for this improvement !

Comment thread doc-deploy-dev/action.yml Resolved
Comment thread doc-deploy-stable/action.yml Resolved

@jorgepiloto jorgepiloto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the hard work, @klmcadams. Merging and patch-releasing this.

@klmcadams
klmcadams merged commit 944342f into main May 7, 2024
@klmcadams
klmcadams deleted the maint/check-gh-pages branch May 7, 2024 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Generic maintenance related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants