I was just reading about George Orwell being a volunteer for the republican army, so I wonder what was the process behind joining the war as a volunteer
Orwell, as it happens, is actually a really good illustration of more than one of the ways you could volunteer!
Foreigners took part in the Spanish Civil War from the very first days of the conflict - the People's Olympiad (a kind of counter-Olympic Games for nations/groups that refused to participate in the Berlin 1936 games for political reasons) was due to start in Barcelona just a few days after the rebellion started, so there was an unusually large number of politically-inclined young men and women in the country to begin with. More came to Spain soon after - as the conflict took on increasing international significance, it became a magnet for people who were already itching for the chance to confront fascism directly, for either abstract political reasons or because they already lost the fight at home and were living in exile waiting for revenge. In these early days, with the French frontier open and a confused hodgepodge of different Republican militias operating, volunteering was simply a matter of crossing borders and convincing one of the militias to take you on. Particularly in Anarchist columns operating in Catalonia (where the easiest crossing point with France was), small, scattered groups of foreign volunteers grew relatively common.
This meant that the initial wave of volunteers could be quite heterogeneous, covering not just idealists (for a quite varied set of ideals at this point) but also mercenaries and adventurers who saw the conflict itself as the opportunity rather than the political stakes. Those who made it to Spain integrated themselves into the haphazard structures of the Republican forces as best they could, generally by attaching themselves to whatever militia column best reflected their beliefs and/or would take them. It's important to remember just how chaotic the Republican state and armed forces were in these crucial early weeks - there was no formal centralised process, and getting to fight was more about convincing local militia, political party or trade union leaders that they should trust you and let you join them.
However, in autumn 1936, volunteering started to change drastically. This was partly due to the Republican Government gradually re-establishing itself as a cohesive state, but mostly because the Soviet Union made a decision to actively intervene to support the Republic. Part of this intervention involved selling arms and supplies, providing a safe(ish) home for Spanish gold reserves to finance further overseas purchases and sending military advisors and specialists. For our purposes though, the key decision was that instead of trying to send an entire army to Spain to fight - which Stalin had little desire and most importantly limited capacity to do - they would try and facilitate the recruitment of international volunteers with military experience to bolster the inexperienced and poorly (barely) trained Spanish militias. These units would become known as the International Brigades, and unlike earlier groups of volunteers, they would act as independent formations rather than scattered groups of foreign volunteers in Spanish units.
Responsibility for organising this process was placed on the Communist International (Comintern), the organisation responsible for coordinating the various political parties that adhered to the Soviet model. Given the basic geography, the French Communist Party (PCF), which was quite well established at this point, was vital in establishing a route for international volunteers to reach Spain. Even after France started clamping down on volunteers and closing the frontier in January 1937, the PCF and Comintern soon established alternative routes, smuggling volunteers on foot across the Pyrenees. Basically, if you could make it to Paris (and other communist groups could help you with that, the PCF could get you the rest of the way. With this network in place, a huge flood of volunteers made it to Spain over the winter of 1936-7 even after the border closed - but these volunteers were much more homogenous, recruited through groups with close ties to the USSR.
Orwell came at this key period of transition, when it was still just about possible to make it to Spain independently, but after communist-controlled networks had established themselves as the main route to Spain. Orwell had actually applied to join the International Brigades in London, but failed to convince the Communist Party of Great Britain (CPGB) that he was politically reliable enough - they weren't massive fans of his recent writing (this was pre-Animal Farm and 1984, the issue was more that they saw Orwell as middle-class dilettante), and figured he just wanted to go to Spain so he could write about it rather than being fully dedicated to the cause. Orwell instead managing to leverage connections with the Independent Labour Party, which in turn had connections with a small Spanish revolutionary party (the POUM), and Orwell was able to join a small group of non-communist international volunteers serving in their militia on the Aragon front.
Orwell's rejection from joining the International Brigades hints at what the volunteering process looked like by late 1936 (and continued to look like until mid-138, when volunteering stopped more or less completely). With the Comintern running the easiest route to Spain (and for most people without the knowledge and resources to get themselves across border, the only practically viable route), volunteering was in practice controlled by groups like the CPGB and PCF: Communist Parties with formal ties to Moscow. While in theory non-communists could join (in fact, it was highly encouraged, as the Comintern line after 1935 was to build political coalitions with other left-wing groups to oppose fascism), given that volunteering was technically illegal in most countries, actually volunteering required that you have some existing contacts who could let you know who you needed to talk to. It wasn't like they could advertise - knowledge of how to volunteer mostly spread through word of mouth, which meant that it mostly reached existing communist circles.
The result of these various processes was that the International Brigades were dominated by communists, with national units generally run by their respective national communist parties (the American Abraham Lincoln Battalion, for instance, was dominated by Communist Party of the USA leaders). Not every volunteer from this point onwards was a formal member of a communist party - depending on the national grouping, the figure was usually somewhere between 40-60% - but even those who weren't formal members were those considered politically reliable by the Party (unlike Orwell) and had broadly accepted that the communist policy of confronting fascism was the correct one. While these units were not always politically harmonious in practice, not least because they went through some brutal, disillusioning experiences, they were a far cry from the very varied array of volunteers that first went to Spain.