title: Using the Google Cloud Platform for deploying React applications
body: <p>I have a basic React application generated using: <code>create-react-app</code>. </p>
  
  <p>My source code is hosted on GitHub. </p>
  
  <p>I wish to use the Google Cloud Platform to host my React application.</p>
  
  <p>(I also have a custom domain).</p>
  
  <p>Every time a push/ merge/ code change is made on the <code>master</code> branch, I wanted the hosted application on GCP to update my website contents from <code>master</code>. </p>
  
  <p>Previously I have been unsuccessful in following the instructions provided by Google in setting up a continuous integration process for updating &amp; deploying my application. </p>
  
  <p>I used the Google Cloud Build GitHub app in attempt to update &amp; build my application but with no success. </p>
  
  <p>My <code>cloudbuild.yaml</code> file consisting of:</p>
  
  <pre><code>steps:
    - name: 'gcr.io/cloud-builders/npm'
      args: ['install']
    - name: 'gcr.io/cloud-builders/npm'
      args: ['build']
  </code></pre>
  
  <p>I also had a bucket set up with a working <code>appspot.com</code> URL (having cloned &amp; deployed the application using the built in console on the GCP website) - which was mapped to my custom domain. </p>
  
  <p>My attempts at updating this deployed version failed miserably.</p>
  
  <p>In frustration of trying to achieve my desired workflow, I switched to Netlify which allowed me to achieve what I wanted, and deleted my project from GCP.</p>
  
  <p><strong>I am now attempting to start another project from scratch</strong> (on GCP) and needed some assistance in making sure I set up this new project correctly, a step by step guide if you will. I'm a complete novice when it comes to production level deployment of applications, having only practised with and developed 'dev' level applications on my own machine and I haven't found anywhere else that will help me achieve what I would like to do.</p>
  
  <p>The workflow I am trying to achieve is as follows:</p>
  
  <ul>
  <li>I make changes to my code on the master branch</li>
  <li>Changes get pushed to GitHub/ the master branch</li>
  <li>Changes get pulled from GitHub into GCP and the website gets updated</li>
  <li>I can see the changes when I visit my custom domain</li>
  </ul>
  
  <p>How can I achieve this properly? Or is GCP not the ideal solution for this?</p>