Home
Deploying Websites
- Push your code to git. Have your deployable code in the “docs” folder
- Make sure it is all correct because it maybe hard to change the website once it is deployed
- Go to “Settings” tab and click “Pages” on the left side
- Change “none” to your branch you want ot deploy from
- Change “/(root)” to “/docs”
- Click “Save” and wait. It may take a while
- Any new pushes to that branch should be automatically deployed
- If any new changes are taking a very long time to deploy then you need to create a new repo with your code and deploy from that.
- On github go to user -> Settings -> Pages
- Click Add a domain
- Put your domain name in and follow the direction(Adding A TXT DNS record).
- Click Add domain and wait for it to verify
- Go to your github pages repo -> Settings -> Pages
- Add you Custom domain and click save
On Porkbun
- Login
- Account -> Domain Management
- Click the arrow down in the red box on the right of you domain name you want to use
- Under DNS RECORDS click Edit
- Remove the 2 default DNS records of type ALIAS and CNAME*
- Add TYPE CNAME, Host www, and ANSWER (github username).github.io.
- Add 4 TYPE A DNSs. Leave the Host blank and put these 4 ip addresses
- 185.199.108.153
- 185.199.109.153
- 185.199.110.153
- 185.199.111.153
- These may change in the future. So double check on this website.
You have to wait around 30 mins.
- After around 30 min on your github pages repo click Check Again under your Custom domain
- Login or create Heroku account at
https://id.heroku.com/login
- Click on top right “New” and click “Create new app”
- Give an app name of
{github username}-{github repo name}
- Make sure to replace any spaces or underscores with dashes
- You can name it whatever you want, but this is the recommended naming convention
- Click create app
- Go to “Deploy” tab and set your deployment method to github and connect your github repo
- Got to “Settings” tab and set your buildpack to what your app is using.
- Make sure to have the Heroku CLI installed at this link https://devcenter.heroku.com/articles/heroku-cli
- On Linux:
curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
- Run
heroku login
in the terminal
- A website should popup and make sure to login there
- Make sure your code is pushed to your git branch
- Run
heroku git:remote -a my-app
, but replace my-app with the app name you gave.
- This should create a new heroku location for git
- Run
git subtree push --prefix my-subdirectory heroku master
, but replace my-subdirectory with your root directory and replace master with your branch you want to deploy from.
- This will make Heroku use my-subdirectory as the root directory
- On the Heroku website go to Settings and click Show Config Vars
- In nodeJS use the package dotenv and use the Keys that are in your Config Vars
- Go to Resources
- Search for JawsDB MySQL
- JAWSDB_URL should be automatically added in your config vars
- On heroku website go to Settings
- Click Add domain
- Paste your domain name
- Copy the DNS target link
On Porkbun
- Login
- Account -> Domain Management
- Click the arrow down in the red box on the right of you domain name you want to use
- Under DNS RECORDS click Edit
- Remove the 2 default DNS records of type ALIAS and CNAME*
- Set type to ALIAS, leave Host blank, and past your heroku DNS target link under Answer. Then Click Add
- Set type to CNAME, under Host put *, and past your heroku DNS target link under Answer. Then Click Add
npm run build
to get a dist folder
- Go to netlify
- Drag and drop dist folder into sites in netlify
- Domain management
- Add domain name
- Type your registered domain name -> Add domain (There should be something saying it was already registered) -> Add domain again
- On your domain name click options -> Set up Netlify DNS
- Verify -> Add domain -> Continue -> You should get ~4 domain name servers. Make sure to copy these.
On your register website(Not netlify) paste those ~4 domain name servers in.
Vercel doesn’t allow you to make monetary transactions on the free tear.
- Top left ryansheehy0’s projects
- Click the 3 dots to the left of your project
- Manage domains
- Add A record to DNS on porkbun
- Add CNAME record to DNS on porkbun
When adding domain names add the A records and the C
MongoDB Atlas
- Top left project dropdown -> + New Project
- Name your project
- Create Project
- Create a deployment
- For this user there should be an auto-generated username and password. Make sure to save the auto-generated password.
- Create User
- Finish and Close
- Left side -> Under the green security header -> Network Access
- Edit button
- Allow access from anywhere
- Confirm
- Left side -> Overview
- Green connect button
- Drivers
- Copy the connection string which starts with
mongodb+srv://
- Replace
<password>
with the password from your user you saved.
- You can now connect to the db with this link
- Left side -> Under the green Deployment header -> Database
- Click on cluster name link in blue
- Right side 3 dot buttons
- Terminate
- Wait for cluster to shut down and be removed
- Top left project dropdown -> View All Projects
- Delete your project with the trash button
- Porkbun
- Under your domain name. Small red NS and paste in.