Learn how to publish an app from GitHub: create a repository, push your code, enable GitHub Pages, verify your site, and set up a custom domain if needed.
Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
Step 1: Create or Choose Your Repository
First, sign in to your GitHub account. You can either create a new repository or use an existing one that contains your web application code.
my-web-app
), add an optional description, and choose public or private visibility.
Step 2: Push Your Local Code to GitHub
If your app code is on your local machine, follow these commands to push it up:
# Navigate into your project folder
cd path/to/your-project
# Initialize a new Git repository (if you haven't already)
git init
# Add all files and make your first commit
git add .
git commit -m "Initial commit of my web app"
# Add the GitHub repo as a remote (replace URL with your repo URL)
git remote add origin https://github.com/your-username/my-web-app.git
# Push your code to the main branch
git push -u origin main
master
), replace main
accordingly.
Step 3: Configure GitHub Pages
GitHub Pages will host your static site directly from your repo. To enable it:
main
) and the folder (/ (root)
for static files in the repo root, or /docs
if you keep your built site there).
Step 4: Verify Your Published App
After a few seconds, your site will be live at the URL shown in the Pages settings (for example, https://your-username.github.io/my-web-app
).
Step 5: (Optional) Set Up a Custom Domain
If you have your own domain name, you can point it to your GitHub Pages site.
CNAME
in your repository’s root (or in /docs
if that’s your Pages folder) containing just your custom domain (e.g., www.example.com
).www
to your-username.github.io
. If you want an apex domain (example.com
), use A records pointing to GitHub’s IP addresses.When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.