You may be interested to know that both Maxwell's and the Einstein Field Equations can be derived by minimizing an action, cf.
https://en.wikipedia.org/wiki/Einstein%E2%80%93Hilbert_actio...
https://en.wikipedia.org/wiki/Electromagnetic_tensor#Lagrang...
Enjoy!