Below is a simple solution that actually works. Google's documentation is far overcomplicated and of little use. And their "tech support" was not able to resolve the issue.
This is how I was able to update my static site on gcloud using the command line utility.
- Create a new bucket, ideally name it with a version like appname-v2
- Copy your recent build into that bucket
- Delete the old bucket
- From your main area in your console where you see your app's directory do
gsutil rsync -r gs://[bucketname] ./appname
cdinto the directory
gcloud app deploy
So if your latest version of your app is 3, if your app's directory is stackoverflow, and your bucket is "bucket" then your
gsutil command would look like
gsutil rsync -r gs://bucket-v3 ./stackoverflow
Gcloud console - shows naming for bucket's version
Deployed site - test
There are plenty of related questions, they drone on and on and on about "cache" etc. It's all pointless to read. Just delete the old bucket and redeploy.
Of course this was for a small app, there are ways to "properly do it" but good luck finding it in the documentation. Everyone that I know that works with gcloud has several workarounds.
- Missing a step to update a static ReactJS site on GCloud
- Reactjs console error ([HMR] Waiting for update signal from WDS...)
- How to update ReactJS component based on URL / path with React-Router
- When should ReactJS components make AJAX calls to update state from props?
- How to serve ReactJS static files with expressJS?
- how to share environment variables between react app and express js server hosting it as static site
- How to update url hash when scrolling through sections in ReactJS
- Fastest way to add pre-existing static HTML page to a React/Gatsby site
- Reactjs - Update options by hitting API on every input change in Autocomplete component (Material UI)
- Embedding Reactjs in Remote Site iFrame
- Can't clear Gatsby static site cache
- ReactJS - Route update link but not refresh page
- How to get URL query string on Next.js static site generation?
- How to update Reactjs based PWA to the new version?
- how to update input text which is render by array map in REACTJS
- Static method is undefined in ES6 classes with a decorator in reactjs
- How to fix "Failed to load resource: net::ERR_FILE_NOT_FOUND" for static images on cordova app using Reactjs and create-react-app
- React static site with webpack
- How to update state in specific rows in a table ReactJS
- reactjs setState before render on update
- Static hosting - ReactJS app on Azure Blob storage with Azure CDN
- What is the difference between server side rendering (Next.js) and Static Site rendering (Gatsby.js)?
- useEffect is missing a dependency, but when I add it I get a 'maximum update depth exceeded' error
- ReactJS onClick state change one step behind
- error map in missing props reactjs proptypes
- create a mobile app from my web site using reactjs (not native)
- How to update state in map function in reactjs
- Update state values with props change in reactjs
- ReactJS state updates one step behind
- ReactJS - Inline styling does not update upon rerendering of component
More Query from same tag
- can't get countdown timer to work
- Refactoring getDefaultProps to ES6... what's wrong with my code ?
- ReactJS - After .setState called successfully other properties become undefined
- Accessing state in a parent component from a child component
- How to remain state when page refresh in react?
- Reusing actions across multiple reducers in redux
- Getting an API URL id from another API data not working properly
- How to change calls to localhost into external api calls when deploying app to Heroku?
- Uncaught TypeError rendering <Router> using React Router in ES6: type.toUpperCase is not a function
- React lifecyle methods, to componentWillReceiveProps or not
- how to compare the query value from url to id using react?
- Uploading images with fetch to Express using Multer
- Function A calls function B, while function B calls function A: ESLint gives error: 'functionB' was used before it was defined
- plugin/preset files are not allowed to export objects only functions
- select onchange event.value is undefined
- React build fails when sass uses calc and var together
- Move the logic into new action
- Flux / Alt not updating props from store
- How to fetch all documents from a firebase collection where each document has some sub collection and in sub collection there is a document?
- How to pass in the state to the dispatch action if using useState instead of this.state in react?
- Does React.lazy() works with Create React App?
- React Router: Handling queries through React router
- How to get error body using React Apollo Link Rest
- When (where) to read React router params for data retrieval into props?
- ReactComponent Button value won't render on my react app
- Calling useState hook in child - state data is empty
- react-router: unable to route to child components
- How to fix React filter search bar
- Issue with reading a local file before loading into firebase database?
- React setState not setting property to File value