Why does GitHub Actions remove containers after run?

The Docker container I install on Ubuntu 20.04 in GitHub Actions needs to run for a few hours after installation. But, the container is stopped and deleted by GitHub right after installation.
Why does this happen? How can I stop this from happening?

Could you explain a bit more what exactly you’re trying to do? As a matter of design the GitHub hosted runner VMs are destroyed after each job, so if you’re trying to keep anything running there that’s not going to work.

@jesterxd is trying to violate:

As seen here: