You may wish to take reference from the policy of Open Corporates, which has clearly analysed its rights to maintain a public archive under GDPR:
Our grounds for processing personal information
We collect, store, use and make personal information available in
order to further our public interest mission – namely to maintain an
accessible record of company data. We rely on Article 89 of the GDPR
which covers archiving purposes in the public interest.
In the vast majority of cases, the personal information we collect
will also have been made public by the data subject themselves through
the submission of such information to a public register.
Companies House publishes records by law, not by consent of the subject. When a person chooses to become a company director, LLP partner or secretary, then the quid pro quo for limited liability, as determined by legislators through legislation, is transparency.