Update the contract address and network in subgraph.yaml to the correct values.
Update SUBGRAPH_NAME (e.g. millionpieces/subgraph) and ACCESS_TOKEN in ./package.json to the correct values. If you have not account on TheGraph then create it.
Run yarn install
Run yarn run codegen
Run yarn run deploy. The deployed subgraph can be found at https://thegraph.com/explorer/dashboard