I'm looking for a dataset that relates the location of minerals or other valuable resources like gold or oil to the geological conditions in which they occur. So for example for a certain location, it could have the surface pressure, temperature, soil info, etc. Where can I find something like this?
You will most likely need to combine multiple datasets to get what you are looking for here. As mentioned in High Resolution Mineral Maps, you can find some of this information in the USGS Mineral Resources Data API, including mineral availability (by region, resource, or boundary) and some geologic and soil conditions.
You may also find the Global Lithological Map (GLiM) from Hamburg University's Institute for Geology useful for surveying geologic conditions.