It will not be simpler to assume that $x(t=0)=0$, so let us consider general initial conditions
$$\tag{1} x(t=0)=x_0\quad\text{together with}\quad\dot{x}(t=0)=v_0.$$
Now the constant $A$ has dimension of jerk and the constant $m$ has dimension of mass. We can effectively put the constants $A=1=m$ to unity by scaling the variables appropriately
$$x ~\longrightarrow~Ax, \qquad x_0 ~\longrightarrow~Ax_0, \qquad v_0 ~\longrightarrow~Av_0, \qquad t ~\longrightarrow~t,$$
$$\tag{2}p ~\longrightarrow~mAp, \qquad H~\longrightarrow~mA^2 H, \qquad S~\longrightarrow~mA^2 S. \qquad $$
[In other words, if we treat time $t$ as dimensionless, then we are effectively going to dimensionless variables. We can always in the end of the calculation restore the $A$- and the $m$-dependence by performing the opposite scaling of eq. (2).]
Now recallrecall that the Hamilton's principal function $S(x,P,t)$ is a type 2 generating function for a canonical transformation $(x,p) \to (X,P)$, so that
$$\tag{3} p~=~\frac{\partial S}{\partial x} ,\qquad X~=~\frac{\partial S}{\partial P},\qquad K-H~=~\frac{\partial S}{\partial t}. $$
Next recall that the Kamiltonian $K\equiv 0$ vanishes identically, which implies that the new canonical variables $(X,P)$ are constants of motion (COM). Now where are we going to find two COM? Well, the two initial conditions (1) are two COM. Here it helps that OP has already found the full explicit solution by another method
$$\tag{4} x~=~x_0 +v_0 t +\frac{t^3}{6}\quad\text{and}\quad p~=~v_0 +\frac{t^2}{2}.$$
Let us therefore identify the new canonical variables with the initial conditions
$$ \tag{5} X~\equiv~x_0 \quad\text{and}\quad P~\equiv~v_0 . $$
Hence we get
$$\tag{6} \frac{\partial S}{\partial x}~\stackrel{(3)}{=}~p ~\stackrel{(4)}{=}~v_0 +\frac{t^2}{2} \quad\text{and}\quad \frac{\partial S}{\partial v_0}~\stackrel{(3)+(5)}{=}~x_0 ~\stackrel{(4)}{=}~x - v_0 t -\frac{t^3}{6}. $$
Eq. (6) has the full solution
$$\tag{7} S(x,v_0,t)~=~(v_0 +\frac{t^2}{2})x- \frac{v_0^2 t}{2} -\frac{v_0t^3}{6} +S_0(t)$$
for some function $S_0(t)$, which can only depend on the time variable $t$. Inserting eq. (7) into the Hamilton-Jacobi equation yields
$$\frac{v_0^2 }{2}+\frac{v_0t^2}{2} -tx -\frac{\partial S_0}{\partial t} ~\stackrel{(7)}{=}~-\frac{\partial S}{\partial t}$$ $$\tag{8} ~\stackrel{\text{HJ eq.}}{=}~H~=~\frac{p^2}{2} -tx~\stackrel{(4)}{=}~\frac{1}{2}\left(v_0 +\frac{t^2}{2}\right)^2-tx,$$
which leads to
$$\tag{9} S_0(t) = -\frac{t^5}{40} $$
plus an irrelevant integration constant.