Question: I have this metric:
$$ds^2=-dt^2+e^tdx^2$$
and I want to find the equation of motion (of x). for that i thought I have two options:

1. using E.L. with the Lagrangian: $L=-\dot t ^2+e^t\dot x ^2 $.
2. using the fact that for a photon $ds^2=0$ to get: $0=-dt^2+e^tdx^2$ and then: 
$dt=\pm e^{t/2} dx$.

The problem is that (1) gives me $x=ae^{-t}+b$ and (2) gives me $x=ae^{-t/2} +b$.

Answer: 
If your solution is not a null geodesic then it is wrong for a massless particle.

The reason you go astray is that Lagrangian you give in (1) is incorrect for massless particles. The general action for a particle (massive or massless) is:

$$ S = -\frac{1}{2} \int \mathrm{d}\xi\ \left( \sigma(\xi) \left(\frac{\mathrm{d}X}{\mathrm{d}\xi}\right)^2 + \frac{m^2}{\sigma(\xi)}\right), $$

where $\xi$ is an arbitrary worldline parameter and $\sigma(\xi)$ an auxiliary variable that must be eliminated by its equation of motion. Also note the notation

$$ \left(\frac{\mathrm{d}X}{\mathrm{d}\xi}\right)^2\equiv \pm g\_{\mu\nu} \frac{\mathrm{d}X^\mu}{\mathrm{d}\xi}\frac{\mathrm{d}X^\nu}{\mathrm{d}\xi}, $$

modulo your metric sign convention (I haven't checked which one is right for your convention). Check that for $m\neq 0$ this action reduces to the usual action for a massive particle. For the massless case however, you get

$$ S = -\frac{1}{2} \int \mathrm{d}\xi\ \sigma(\xi) \left(\frac{\mathrm{d}X}{\mathrm{d}\xi}\right)^2. $$

The equation of motion for $\sigma$ gives the constraint

$$ \left(\frac{\mathrm{d}X}{\mathrm{d}\xi}\right)^2 = 0, $$

for a null geodesic. This is necessary and consistent for massless particles, as you know.

The equation of motion for $X^\mu$ is (**EDIT**: Oops, I forgot a term here. Note that $g\_{\mu\nu}$ depends on $X$ so a term involving $\partial\_\rho g\_{\mu\nu}$ comes into the variation. Try working it out for yourself. I'll fix the following equations up later):

$$ \frac{\mathrm{d}}{\mathrm{d}\xi}\left(\sigma g\_{\mu\nu}\frac{\mathrm{d}X^{\mu}}{\mathrm{d}\xi}\right)=0, $$

but you can change the parameter $\xi\to\lambda$ so that $\sigma \frac{\mathrm{d}}{\mathrm{d}\xi} = \frac{\mathrm{d}}{\mathrm{d}\lambda}$, so the equation of motion simplifies to

$$ \frac{\mathrm{d}}{\mathrm{d}\lambda}\left(g\_{\mu\nu}\frac{\mathrm{d}X^{\mu}}{\mathrm{d}\lambda}\right)=0, $$

which you should be able to solve to get something satisfying the null constraint.
There is an elegant way of doing this using symmetries.

Notice that this metric is space translation invariant, so it has a killing vector $\partial\_x$. There is a corresponding conserved quantity $c\_x$ along geodesics $x^\mu(\lambda)$ given by
\begin{align}
 c\_x = g\_{\mu\nu}\dot x^\mu(\partial\_x)^\nu = e^t\dot x
\end{align}
Where an overdot denotes differentiation with respect to affine parameter. On the other hand, the fact that the desired geodesic is a (null) photon geodesic along which $ds^2 = 0$ gives
\begin{align}
 0=-\dot t^2 + e^t\dot x^2
\end{align}
This forms a set of coupled differential equations that is not actually that hard to solve. Hint: Try solving the first equation for $\dot x$, and then plugging it into the second equation.