This application contains a simple configuration to run and deploy HTML, CSS and JS websites on Github pages.
Configuration is managed with snowpack
and deployment is run through GH Actions. Packages are managed with npm
.
The action contained in the actions workflow Build Into -b gh-pages
will create a build configuration inside the gh-pages
branch.
Subsequently, the pages build and deployment workflow will publish a version of the gh_pages
branch at the root to Github Pages.
🚀 Voila ...
- Clone this repository - git clone https://github.com/urbanbigdatacentre/snowpack-ghpages.git
- For starters ... edit
index.js
andindex.html
- Run
npm run build
- Run
npm start
- Create your own Github Repository to work with - https://docs.github.com/en/get-started/quickstart/create-a-repo
- Under the pages tab of your repository settings - set up Github pages to track the
root
folder within thegh-pages
branch - Add this 👆 repository as a remote -
git remote add origin <your repo>
- Add your files -
git add .
- Commit your files -
git commit -m "Initial Commit with My Changes
- Push your changes -
git push -u origin main
- The actions to deploy your site are setup to run automatically on a new push to the
main
branch. - Wait a few minutes - or follow the progress in the repositories Actions tab. That's it!
Runs the app in the development mode. Open http://localhost:8080 to view it in the browser.
The page will reload if you make edits. You will also see any lint errors in the console.
Builds a static copy of your site to the docs
folder.
Your app is ready to be deployed!