I'm new at this: is there any way to let github build a page with the index.html file that is placed in a folder instead of readme?
I've been successfully building a lot of pages with that the index file isn't in a folder. But when it comes to websites that include Angular or node.js, the index file has to be in a folder so when github builds a page, the readme file appears instead of the actual site.
Is there a solution?
https://github.com/JanviaveTharwat/weather-app
That's one of the websites built with node.js. This is what appears to me after building page
https://janviavetharwat.github.io/weather-app/
https://github.com/JanviaveTharwat/angular-store-
Here is the second website with Angular. This is what happened:
https://janviavetharwat.github.io/angular-store-/
Can you help me ?
You can follow this guide for deploying Angular applications to GitHub Pages from the official Angular documentation here and the GitHub Pages documentation for the setup on GitHub itself here.
These are the steps as of Dec 23 2022:
Assuming your project already has an GitHub repository, follow these steps:
Create and checkout a git branch named gh-pages:
git checkout -b gh-pages
Build your project with the following command and flags:
ng build --output-path docs --base-href /<your-project-name>/
When the build is finished, make a copy of the docs/index.html file and name it docs/404.html
Commit your changes and push them - make sure that the docs directory is included
On the project GitHub repository, go to Settings
In the Code and automation section of the sidebar, click on Pages
Under Build and deployment, under Source select Deploy from a branch
Under Build and deployment, under Branch and select your gh-pages branch
Use the drop-down to the right of the branch drop-down to select the docs folder
Click Save. Your application should now be deployed and accessible under https://<user_name>.github.io/<project_name>
Related
I've deployed sites on Netlify before so I know how to use the website. The only difference is that those sites were created via React.js. The website I'm trying to deploy is an old project of mine but I didn't use React at the time so it couldn't be opened using "npm start" "npm build" etc.
So how do you deploy a site that doesn't use React into Netlify? I tried looking for answers online but I couldn't find the specific answer that relates to mine.
Netlify has nothing to do with React, it can build and host many different types of site with various frameworks.
When configuring your Netlify site, you can set the following options:
Base directory: Optional field to set the directory that the buildbot changes to before starting a build. If not set, the base directory defaults to the root of the repository.
Build command: If you are using a static site generator or other build tool, this is where you should specify the command to run to build your site. For example, npm run build.
Publish directory: Directory that contains the deploy-ready HTML files and assets, either generated by the build step or pre-built.
Is it possible to change a file on Netlify after the site has already been built?
Example:
If I have a site:
https://physiome-test.netlify.com/simple_heart/ that accesses a file at
https://physiome-test.netlify.com/simple_heart/models/organsViewerModels/cardiovascular/heart/ecgAnimation.json
Is there any way that I can change this file without having to update my github repository?
Is there any way that I can change this file without having to update my github repository?
Using Netlify continuous deployment, which is what you are doing, you can't just change one file on Netlify without changing the files in your git repository that is tied to building your build process.
Process Netlify uses:
On commit trigger (webhook from GitHub) or a trigger deploy in the app.netlify.com admin
Checkout your target branch
Runs your build command
Compares your current build to existing CDN contents
Updates global CDN for changed files in your target deploy location
Changing Netlify Files without changing git
A new feature allows you to drag a deploy folder to app.netlify.com for fast review/deploy without using your git repository. Go to the Deploys tab of the site you want to update. You will see a message at the bottom like the pic below:
Drag your deploy folder to this location from your local system and your site will be updated with any new files on Netlify.
Note: All the files of your site must be in the folder with your current changes.
The netlify-cli can deploy directories without modifying a git repo.
Here is an example usage:
npm run build
netlify status
netlify deploy
and if everything looks good on your draft URL, take it live with the --prod flag.
netlify deploy --prod
Everything will update automatically.
Have you tried NetlifyCMS? https://www.netlifycms.org/
You can edit content on Netlify and it is integrated to Git workflow.
I want to deploy my .Net project from GitHub repository to the azure server.
In Deployment options I am getting Building failed error.
Here are screen shots of my Deployment details and Logs
1- Deployment Details:
2- Activity Log:
According to your description and logs, I found you have error in MSbuild step.
The error shows some files not found in your project. I suggest you could exclude the related files in the csproj file or make sure the related files is in your project.
Besides, I suggest you could firstly clone the project to your local and test it , make sure the project could build well without any error then publish to the GitHub and deploy to the azure.
Update:
I also write a test demo on my computer and I reproduce your error.
Error image:
I think in your project you have inclued the bin and obj folder into your project and then you push the project to the github.
Like below:
After you push the project to the github, the csporj file will include all the bin and obj references.
Like below:
This is the reason about your MSBuild fail.
So I suggest you uninclude all the bin and obj folder in the local and push to the github again. Then it will work well.
Azure looks in your site/repository/packages folder for all the packages your app uses. By looking through it you will find that visual studio doesn't deploy all of the files from your local packages folder to the azure one. MSBuild needs these files when you push to git and trigger a build. Ftp into your azure site and look for the packages folder. Upload every missing file (dll) from your local folder to the azure one. This worked for me and now I can trigger a build and deployment from bitbucket to azure app service upon a push.
Additionally, if you have other projects in your VS solution and you are using VS to build those projects and then put the dll into your main projects bin folder, that will cause a missing file error also. I create a folder in my packages folder and link the dll to my main folder from there. That way when you perform the fix above, the file needed by your main project is in the packages folder also.
I hope this helps!
I'm unsure how to deploy my web application to heroku where the actual web application is generated within a sub folder. I have the project tree:
app
assets
dist
server
// other stuff ....
now when I want to run my server & frontend, I do gulp. gulp creates a folder named build which contains all needed files for running the web app, so my file tree would become
app
assets
dist
server
build
// other stuff ....
Is there a way to initialize the heroku repository to only the folder build? Since my actual web app lies inside just that folder, it's probably easier for me to only have heroku think the build folder exists.
I currently have heroku setup with only heroku create inside the parent repo
I found a solution to my issue. What I decided to do was include my build folder into my repository (did not add much bloat, only like 50kb). Then, when I wanted to deploy to heroku I did:
git subtree split --prefix build -b deploy
git push heroku deploy:master
git branch -D deploy
this created a branch with only the build folder, pushed that to heroku (use -f if you need to overwrite previous commits), the deleted the deploy branch.
Worked like a charm!
I'm trying to find information online about how to deploy an angular2 with webpack app to azure, but I couldn't find anything helpful enough. I checked the start package as suggested here How do you deploy Angular 2 apps? but I also couldn't find much help there.
So, I have an angular2 app running with webpack locally. It's working perfectly locally. But how do I deploy it to Azure Web Apps?
I appreciate any help :)
Thanks!
Well, so I was able to get it working.
After researching I found out there are a few options to go by, mainly creating your own local prod build and uploading it and using CD/CI. I went with the latter. It took quite some time, but now it's all set I don't have to worry about it anymore...
I based myself in this tutorial http://tattoocoder.com/angular2-azure-codeship-angularcli/ by Shane Boyer but since link-only answers are discouraged I'm going to write it here.
Here's how I did it:
Create a branch release on GitHub (I use this one to publish)
Create a free account on CodeShip and import the GitHub repo
On Configure Project select I want to create my custom commands and use this code:
nvm install 4.1
npm install angular-cli
npm install
Then this one under Test pipeline:
ng serve &
ng e2e
ng build -prod
Click Save and go to dashboard
Now go to your Azure Portal (https://portal.azure.com/) and open/create your web app
Click on Deployment Options > Choose Source > Local Git Repository
Then click on Deployment Credentials and insert the user/password you prefer
Click on Overview and copy your Git clone url
Go to Project settings > Environment variables and add AZURE_REPO_URL with the value being the git clone url you copied with the user/password (https://username:password#site.scm.az(...).git):
After, click on Deployment on the left navigation menu
Choose the branch you want to deploy from (in my case it was release) and click Save, then click on Custom Script
Then customize and add this script:
git config --global user.email "email#provider.com"
git config --global user.name "Your name"
git clone $AZURE_REPO_URL repofolder
cd repofolder
rm -rf *
cp -rf ~/clone/dist/* .
git add -A
git commit --all --author "$CI_COMMITTER_NAME <$CI_COMMITTER_EMAIL>" --message "$CI_MESSAGE ($CI_BUILD_URL)"
git push origin master
That was it. Now every time you push to GitHub CodeShip will build your code and every time you PR to release it will build AND publish to azure.
Thank https://stackoverflow.com/users/595213/shayne-boyer for this.