Create README.md
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
# Rajanibala Portifolio
|
||||
|
||||
### How To Deploy:
|
||||
|
||||
1. **Make sure you have Node.js, npm, and firebase tools installed**
|
||||
a. Can be downloaded from [Node.js](https://nodejs.org/en/)
|
||||
b. Accept & Install
|
||||
c. Confirm it worked - open Command Prompt and type:
|
||||
```cmd
|
||||
node -v // this command should output a version number, then run next line
|
||||
npm -v // this command should then also output a version number
|
||||
```
|
||||
d. Install firebase tools by running:
|
||||
```cmd
|
||||
npm install -g firebase-tools // should have some success code at the end
|
||||
```
|
||||
|
||||
|
||||
2. **Now that we have the tools installed, lets login to Firebase in terminal.**
|
||||
a. Check you have access [by going here](https://console.firebase.google.com/u/0/project/albarajanibala-a9cb6/overview)
|
||||
b. In Command Prompt type:
|
||||
```cmd
|
||||
firebase login // should open up in Chrome, make sure you login with the right Google account
|
||||
```
|
||||
c. Download the existing code from GitHub if you haven't already _(see button in top right)_
|
||||
|
||||
|
||||
3. **Time to prepare new code and publish.**
|
||||
|
||||
> Before publishing - make sure you have an `index.html` file in the `www` folder
|
||||
|
||||
a. Place your new files or edit the files in the folder called `www`
|
||||
b. Now navigate to the downloaded code from Command Prompt:
|
||||
```cmd
|
||||
// If you downloaded files are at \Downloads\rajanibala
|
||||
cd ~\Downloads\rajanibala
|
||||
```
|
||||
c. Finally time to publish:
|
||||
```cmd
|
||||
firebase deploy --only hosting
|
||||
```
|
||||
> Accidentally pushed?
|
||||
Firebase lets you rollback changes and delete previous versions - this can be done from [Firebase Hosting Dashboard](https://console.firebase.google.com/u/0/project/albarajanibala-a9cb6/hosting/main)
|
||||
|
||||
4. **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 `git` installed - you can [get git from here](https://desktop.github.com/)
|
||||
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.
|
||||
|
||||
1. Open Command Prompt and type
|
||||
```cmd
|
||||
npm install -g http-server
|
||||
```
|
||||
2. Navigate to inside `www` folder in Command Prompt
|
||||
```cmd
|
||||
// If you downloaded files are at \Downloads\rajanibala
|
||||
cd ~\Downloads\rajanibala\www
|
||||
```
|
||||
3. Start server
|
||||
```cmd
|
||||
http-server . \\ Output will have a number after ':' this is called a port number
|
||||
```
|
||||
4. Go to Chrome and open [localhost:8080](http://localhost:8080)
|
||||
> 8080 might not be correct, use the port number that was output in step 3
|
||||
|
||||
Reference in New Issue
Block a user