Workflow appears successful but github.io returns blank page #647
-
This is my first time use of github-pages-deploy-action. The workflow appears to work, but going to the github.io page returns a blank page. I started with a new Angular 10 project using "ng new". I added a .github/workflows/frontend-build.yaml file containing the following:
The workflow appears to run successfully and it creates the gh-pages branch and populates it properly. Viewing the "Tree" for that commit using gitk shows that it contains index.html and the generated .js and .css files. Here is a link to the test repo. You can view the output of the workflow under the Actions tab. Angular 10 now puts the compiled files from a prod build in "dist/<project" folder, instead of just "dist" as was done in prior versions. In my case, that is "dist/ghpages", which I set as the folder to deploy. I tried creating a Github Page for another new Angular 10 project using the NPM package "angular-cli-ghpages". This worked fine and when I go to the github.io page, it shows the Angular app. However, I could not get this to work in a Github Action and that is why I am trying to use your github-pages-deploy-action. The "Tree" in gitk for the gh-pages branch shows the same files as was show in the branch generated by github-pages-deploy-action. [ Edit 2021-03-21 - It returns blank page, not 404. It was returning 404 before , because the repo setting for Github pages was not turned on. I guess it worked with angular-cli-ghpages because it does this automatically. ] |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Your application is deployed here and it's not 404ing, however your runtime scripts are: https://johnpankowicz.github.io/ghpages/ The issue is related to how your application is configured, most likely because it's being served from the |
Beta Was this translation helpful? Give feedback.
-
I solved my original issue. Here are my changes below. You can also look at the sample repo. frontend-build.yaml
Build script in package.json
Set build output path in angular.json
|
Beta Was this translation helpful? Give feedback.
I solved my original issue. Here are my changes below. You can also look at the sample repo.
frontend-build.yaml
Build script in package.json
"build:ghp": "ng build --prod --base-href /ghpages/",
Set build …