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

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

Merged
merged 23 commits into from
May 7, 2024

Conversation

klmcadams
Copy link
Contributor

@klmcadams klmcadams commented Apr 29, 2024

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
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
Member

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

@SMoraisAnsys
Copy link
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
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.

doc-deploy-dev/action.yml Show resolved Hide resolved
doc-deploy-stable/action.yml Show resolved Hide resolved
doc-deploy-dev/action.yml Outdated Show resolved Hide resolved
doc-deploy-dev/action.yml Outdated Show resolved Hide resolved
@SMoraisAnsys
Copy link
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
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
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
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
Member

Let's try and get this merged

@klmcadams klmcadams enabled auto-merge (squash) May 6, 2024 15:09
@RobPasMue
Copy link
Member

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

Copy link
Contributor

@SMoraisAnsys SMoraisAnsys left a comment

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 !

doc-deploy-dev/action.yml Outdated Show resolved Hide resolved
doc-deploy-stable/action.yml Outdated Show resolved Hide resolved
Copy link
Member

@jorgepiloto jorgepiloto left a comment

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
12 checks passed
@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