We show the strategy of introducing azobenzene groups into graphene nanoribbons (GNRs), which not only endows GNRs with fast photo-responsiveness but also induces the self-assembly of the GNRs into ultra-long nanowires.