xxxxxxxxxx
npx angular-cli-ghpages --dir=dist/portfolio-website --no-silent
ng build --base-href "https://github.com/220296006/thabisomatsaba-portfolio-website.git"
xxxxxxxxxx
******************************************************************
note: Step 1 only for vite users for normal npm start from step 2
******************************************************************
// Step 1: add to vite.config.js:
export default defineConfig({
base: "/<repo>/",
})
// Step 2: Add required package
>> npm install gh-pages --save-dev
// Step 3: Add to package.json
"homepage": "https://<username>.github.io/<repo>/",
"scripts": {
"build": "vite build",
"predeploy": "npm run build",
"deploy": "gh-pages -d dist",
// Step 4: Run deploy command
>> npm run deploy
// Step 5: Go to github pages setting: Switch to gh-pages branch if present
republish a website on github
xxxxxxxxxx
You can re-publish your GitHub Pages website by navigating to the Actions tab of your repository, click on the Pages build and deployment workflow, then click the Re-run all jobs button located in the upper right corner of the page. After the workflow run has completed, your site will be published
xxxxxxxxxx
To deploy a website in GitHub, you'll need to follow these steps:
1. Create a new GitHub repository by navigating to your GitHub account and clicking on the "New" button.
2. Provide a name for your repository and choose whether it should be public or private.
3. Once the repository is created, go to the settings of the repository.
4. Scroll down to the "GitHub Pages" section.
5. Under the "Source" dropdown, select the branch you want to publish (usually the main branch).
6. Choose the folder where your website files are present. If it's the root folder, select the root.
7. Click on the "Save" button to generate the website link.
After following these steps, your website will be deployed and accessible using the generated website link.