DEV Community

Vikas Singh
Vikas Singh

Posted on

Part 1: Steps for a site Development

  1. Develop locally with React.
  2. Set up GitHub repo.
  3. Configure GCP Services.
  4. Test your site is working locally.
  5. Connect custom domain.
  6. Set up automation.
  7. Make changes via GitHub

  1. Develop locally with React.
    # Create React app locally first
    npx create-react-app my-website
    cd my-website
    git init
    git add .
    git commit -m "Initial commit"

  2. Set up GitHub repo. Connect local repo to github
    # Connect local repo to GitHub
    git remote add origin https://github.com/yourusername/your-repo-name.git
    git branch -M main
    git push -u origin main

Repo structure
my-website/
├── public/
├── src/
├── build/ (generated)
├── .github/workflows/ (CI/CD)
└── package.json


3.Configure GCP Services.

3.1. GCP Project Creation
Go to Google Cloud Console

  • Create new project
  • Enable billing account

3.2. Required Services
Enable these services:

  • Cloud Build (CI/CD)
  • Cloud Storage (Hosting)
  • IAM (Permissions)

4.React App configuration.
4.1. Create build script in package.json
{
"name": "my-website",
"homepage": "https://your-domain.com",
"scripts": {
"build": "react-scripts build",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
}
}

Top comments (0)