3.0 KiB
Rajanibala Portifolio
How To Deploy:
-
Make sure you have Node.js, npm, and firebase tools installed
a. Can be downloaded from Node.js
b. Accept & Install
c. Confirm it worked - open Command Prompt and type:node -v // this command should output a version number, then run next line npm -v // this command should then also output a version numberd. Install firebase tools by running:
npm install -g firebase-tools // should have some success code at the end -
Now that we have the tools installed, lets login to Firebase in terminal.
a. Check you have access by going here
b. In Command Prompt type:firebase login // should open up in Chrome, make sure you login with the right Google accountc. Download the existing code from GitHub if you haven't already (see button in top right)
-
Time to prepare new code and publish.
Before publishing - make sure you have an
index.htmlfile in thewwwfoldera. Place your new files or edit the files in the folder called
wwwb. Now navigate to the downloaded code from Command Prompt:// If you downloaded files are at \Downloads\rajanibala cd ~\Downloads\rajanibalac. Finally time to publish:
firebase deploy --only hostingAccidentally pushed? Firebase lets you rollback changes and delete previous versions - this can be done from Firebase Hosting Dashboard
-
Updating code to GitHub
This is important so your changes are safely stored for the future. This also helps to easily revert any unwanted changes.
a. To push your changes to GitHub, first make sure you have
gitinstalled - you can get git from here
b. Find your project in GitHub app - go to File > Add Local Repository > (Navigate to inside rajanibala folder)
c. Select your files that you want to push to GitHub
d. Add a description of changes
e. Click "Commit to master"
f. Button in top bar should now say "Push origin" - click that and you're done!
Testing Locally:
To simulate how the website would work on the internet, you can simulate a server locally on your machine.
- Open Command Prompt and type
npm install -g http-server - Navigate to inside
wwwfolder in Command Prompt// If you downloaded files are at \Downloads\rajanibala cd ~\Downloads\rajanibala\www - Start server
http-server . \\ Output will have a number after ':' this is called a port number - Go to Chrome and open localhost:8080
8080 might not be correct, use the port number that was output in step 3