Automatically rebuilds and installs on kernel updates. DKMS is in official sources of Ubuntu, for installation do:

$ sudo apt-get install build-essential dkms git

Clone the driver source from GitHub and the driver source must be copied to /usr/src/8812au-4.2.2

$ git clone https://github.com/gnab/rtl8812au
$ sudo cp -a rtl8812au /usr/src/8812au-4.2.2

Then add it to DKMS:

$ sudo dkms add -m 8812au -v 4.2.2
$ sudo dkms build -m 8812au -v 4.2.2
$ sudo dkms install -m 8812au -v 4.2.2