I am publishing a whole bunch of layers to portal for a project. Is there any way to automate the process instead of individually clicking and sharing as a web layer to portal?
Have you looked at the ArcGIS Pro Python module: https://pro.arcgis.com/en/pro-app/arcpy/sharing/introduction-to-arcpy-sharing.htm
If you would like to automate publishing to Portal, and not ArcGIS Server, you can use the Python API for ArcGIS.
https://developers.arcgis.com/python/sample-notebooks/publishing-sd-shapefiles-and-csv/
https://esri.github.io/arcgis-python-api/apidoc/html/index.html
If you would like to automate publishing to ArcGIS Server, you can use ArcPy or the Python API.