For any sequence $(a_n)_n \subset \mathbb R$, we say that $a \in \mathbb R$ is the limit of $a_n$ if $\forall \varepsilon > 0, \exists N \in \mathbb N $ such that $\forall n \ge N,$ we find
$$|a_n - a| \le \varepsilon.$$
In this case, we denote (this is just a notation):
$$\lim_{n \to \infty} a_n := a.$$
We say that a sequence diverges if the does not converge, that is
$$\forall a \in \mathbb R, \exists \varepsilon > 0, \forall N \in \mathbb N, \exists n \ge N: |a_n - a| > \varepsilon.$$
Similarly, we say the series of $a_n$ converges/diverges if the sequence of partial sums
$$S_n = \sum_{k = 1}^n a_k$$
converges/diverges in the sense described before.
In the case of a divergent series, the notation
$$\sum_{i = 1}^\infty a_n$$
does not make sense in $\mathbb R$ since the limit of $S_n$ does not exist.
However, in the example you gave, notice that
$$S_n = \sum_{i = 1}^n i \to +\infty \quad \text{as }n \to \infty.$$
Therefore, even though $\lim_n S_n$ is not a real number, we sometime denote
$$\sum_{i = 1}^\infty i = +\infty,$$
to suggest that the limit of $S_n$ is in $\mathbb R \cup\{+\infty, -\infty\}$.
If you consider the partial sums of
$$S_n = \sum_{k = 1}^n(-1)^k$$
the notation
$$\sum_k^\infty (-1)^{k}$$
is simply nonsensical in $\mathbb R$ or $\mathbb R \cup\{+\infty, - \infty\}$.