Spontaneous fission half-lives of actinide and superheavy nuclei are calculated using the least-action integral of the Wentzel-Kramers-Brillouin (WKB) tunneling probability through the barrier that appears in the deformation landscape obtained in the macroscopic-microscopic potential-energy surface. This deformation-energy landscape is obtained using a Fourier shape parametrization with four deformation parameters, taking into account the nuclear elongation, left-right asymmetry, neck formation, and nonaxiality degrees of freedom. The collective inertia tensor entering the WKB half-life expression is taken from the so-called irrotational flow model, whose components are scaled by an overall multiplicative factor. For a comparisons, we have also used the so-called phenomenological mass parameter depending only on the center-of-mass difference of the nascent fission fragments. Our approach is shown to be able to reproduce empirical fission half-lives of all here considered nuclei to within three orders of magnitude.