https://www.instructables.com/SudsCycle-a-Bicycle-Powered-Washing-Machine-Protot/
I found this, bit I don't think it's the best solution.
Depending on the tools are resources you have. If I had to create one I would start from a washing machine with broken motor and modify it to connect to bike chain instead of motor.
Edit: another detailed guide: https://homegeargeek.com/how-to-make-a-bicycle-powered-washing-machine/