dstroy0 / InputHandler

Arduino input handler
https://dstroy0.github.io/InputHandler/
GNU General Public License v3.0
1 stars 0 forks source link

build-doxygen is not deploying the correct webpage #46

Closed dstroy0 closed 2 years ago

dstroy0 commented 2 years ago

I haven't even started to dig into it, just noticed it. I checked and the build artifacts are correct, so something is up with deployment I'm guessing.

dstroy0 commented 2 years ago

index.html hasn't been updated for a month according to the commit history on the gh-pages branch, so I'll start looking for what happened around then.

2bndy5 commented 2 years ago

This is interesting. It seems related to changing the workflow step to use a different action.

Looking at the gh-pages branch, it seems that the doxygen output is copied to the gh-pages branch, but part of the build path remains (everything is inside the html folder). I'd guess that changing the gh-pages settings for this repo is the answer. image Hopefully, you can select a folder named "html" from the drop-down options.

2bndy5 commented 2 years ago

I would argue that this a problem with the action being used. If the suggestion from my last comment isn't helpful, then you'd need to play with the action's options to make docs/html get copied to the root folder of the gh-pages branch. My guess for that would be setting target-folder

      - name: Deploy 🚀
        uses: JamesIves/github-pages-deploy-action@v4.2.5
        with:
          branch: gh-pages # The branch the action should deploy to.
          folder: ./docs/html # The folder the action should deploy.
          target-folder: '.' # maybe try this??
dstroy0 commented 2 years ago

It was overwriting some of the files but not all of them... I just deleted the directory and ran the workflow again, and it only copied over some of the files

2bndy5 commented 2 years ago

Yeah, I noticed that too, but didn't think it was the main problem. The doxygen output may be compatible with parts of previous build, but its easier to just assume it isn't. The action is assuming that previous builds are compatible with newer builds 👎🏼

dstroy0 commented 2 years ago

I pushed out the build artifact directly so everything is correct, I'll investigate the workflow tomorrow.

dstroy0 commented 2 years ago

It looks like it's something to do with clean-exclude, if I remove that line the redirect gets removed, and the built files get copied over to gh-pages correctly. If that line is there it doesn't update index.html with the newly built file.

2bndy5 commented 2 years ago

Oh, I didn't realize the index.html in the gh-pages branch's root folder is a redirect. I've always made sure that doxygen's output (including index.html) was in the gh-pages branch's root folder...

dstroy0 commented 2 years ago

I couldn't sort out how to make it deploy into the root, so I added the redirect.

2bndy5 commented 2 years ago

I couldn't sort out how to make it deploy into the root, so I added the redirect.

This is why I think the problem is with your choice of gh-pages deploying action. I can understand using an action that doesn't require a github token (for security risks), but maybe that action isn't the right choice with doxygen.

Alternatively, you could set doxygen's HTML_OUTPUT to ., but that is relative to the OUTPUT_DIRECTORY. This suggestion is talking about the doxyfile.

dstroy0 commented 2 years ago

You know way more about this stuff than I do, I'll look at other actions tomorrow and see if I can't make one work.

dstroy0 commented 2 years ago

I need to fix the Doxyfile so the mattnotmitt action will build successfully

dstroy0 commented 2 years ago

Took me a while to figure out it was a docker container and that the paths were different lol

dstroy0 commented 2 years ago

It's building again, but it's still getting deployed to root/html instead of root, using mattnotmitt build action and peaceiris deploy action

dstroy0 commented 2 years ago

It's building correctly, deploying correctly and not overwriting the redirect.

2bndy5 commented 2 years ago

mattnotmitt build action and peaceiris deploy action

This is a reliable combo. I had used mattnotmitt's build action for a long time until I needed specific versions of doxygen.

This may sound obvious, but have you tried removing the redirect manually?

dstroy0 commented 2 years ago

Yeah I tried that, I can make it deploy to whatever folder I want but it stays inside of the html directory. I changed the destination_dir to docs, and it commits all the built files to /docs/html/.

2bndy5 commented 2 years ago

Strange. We use docs/html as the output path for RF24* libs also, but I haven't had problems with the path on gh-pages.

dstroy0 commented 2 years ago

Tomorrow I will try and change doxygen's output dir to root/build and try and change the actions publish dir to build/ to see if that deploy will commit to the root of gh-pages branch so we can get rid of the redirect permanently.

dstroy0 commented 2 years ago

So, the deploy action is saying that it can't find the directory that I'm building to.

2bndy5 commented 2 years ago

error: tag OUTPUT_DIRECTORY: Output directory '/home/runner/work/InputHandler/InputHandler/build' does not exist and cannot be created

This is going to sound a little confusing, but InputHandler/InputHandler is the root of your repo after the actions/checkout@vx step completes. doxygen is looking for a "build" directory at the root which there is none.

In my experience, Doxygen will only create directories for the HTML_OUTPUT, it will require that the OUTPUT_DIRECTORY specified already exists.

OUTPUT_DIRECTORY = /home/runner/work/InputHandler/InputHandler/build

This setting is meant to be relative to the location of your Doxyfile. The Mattnotmitt action isn't actually running within the same File System that the other steps of your workflow is running in; this is because the workflow runner is a VM, and some actions (any that aren't powered by TypeScript) use Docker containers (which is like a Virtual OS) isolated from the VM with a shared directory (the env var GITHUB_WORKSPACE)... I could go on, but you have a lot to digest there.

  1. If you want to use the root directory for the OUTPUT_DIRECTORY option, then just specify .. since your Doxyfile is in your docs folder.
  2. If you want the HTML_OUTPUT to go into a "build" folder at root, then specify build since that is relative to the OUTPUT_DIRECTORY.
dstroy0 commented 2 years ago

changing the OUTPUT_DIRECTORY tag to /github/workspace fixed it. I got clues from this blob:

/usr/bin/docker run --name b31e91836900fe4427fad80ff22d7d577a4_563478 --label 294b31 --workdir /github/workspace --rm -e INPUT_WORKING-DIRECTORY -e INPUT_DOXYFILE-PATH -e INPUT_ENABLE-LATEX -e INPUT_ADDITIONAL-PACKAGES -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/InputHandler/InputHandler":"/github/workspace" 294b31:e91836900fe4427fad80ff22d7d577a4  "docs/Doxyfile" "/github/workspace/" "false" ""

since the action symlinks? that dir to the runner workspace, it is effectively root?? so weird

dstroy0 commented 2 years ago

I made two errors, the consequence of which did this root/docs/html/html it nested another html directory inside of the directory I was already creating. I misconfigured the Doxyfile.