More than half a million of the 1.69 billion sources in Gaia Data Release 2 (DR2) are published with photometric time series that exhibit light variations during the 22 months of observation. An all-sky classification of common high-amplitude pulsators (Cepheids, long-period variables, Delta Scuti / SX Phoenicis, and RR Lyrae stars) is provided for stars with brightness variations greater than 0.1 mag in G band. A semi-supervised classification approach was employed, firstly training multi-stage random forest classifiers with sources of known types in the literature, followed by a preliminary classification of the Gaia data and a second training phase that included a selection of the first classification results to improve the representation of some classes, before the improved classifiers were applied to the Gaia data. Dedicated validation classifiers were used to reduce the level of contamination in the published results. A relevant fraction of objects were not yet sufficiently sampled for reliable Fourier series decomposition, consequently classifiers were based on features derived from statistics of photometric time series in the G, BP, and RP bands, as well as from some astrometric parameters. The published classification results include 195,780 RR Lyrae stars, 150,757 long-period variables, 8550 Cepheids, and 8882 Delta Scuti / SX Phoenicis stars. All of these results represent candidates whose completeness and contamination are described as a function of variability type and classification reliability. Results are expressed in terms of class labels and classification scores, which are available in the vari_classifier_result table of the Gaia archive.