If an infinitive is preceded by an auxiliary verb and a phrase ending in do (such as What I did was, All we do is, etc.), the to is optional.
From Practical English Usage, 91.5:
Expressions like All I did was, What I do is, etc can be followed by an infinitive without to.
All I did was (to) give him a little push.
What a fire-door does is (to) ...