Hey there,
I’m searching for a solution for my CI/CD setup.
I got 2 repositories repo1 and repo2 while repo2 uses repo1 and should be built when repo1 is built as well.
The built of repo1 should look like this:
Pre:
- Install global dependencies
- checkout repo1 at /
- Install dependencies for repo1
- Checkout repo2 inside repo1 (temporary folder) at /repo1/repo2
- Install dependencies for repo2
Main:
- Lint the sources and run the tests
- Build the distribution files
- Bump the patch version
- Create the change log
- Commit that stuff
- Create a git tag with new version
- Push branch and tag to github
- Create a github release for tag using the changelog
Post:
- Navigate to /repo1/repo2 and build it
- Push changes to github pages of repo2
So given this steps it’s pretty obvious that I need read and write access to two GitHub repositories. One way might be to just add a user key for another robot user which I somehow don’t like^^
Another way could be to create a deploy key for each repository with write access and add them all to the build.
Here it seem to be the problem that I have to add the host for the key and one is overwriting the other which lead to only one accessible repository. Also a deploy key can only be added to one repository at the same time.
I also had a look on how to trigger the build for repo2 seperately but this seem to be not supported by any of those CI services in a nice way.
So do you have any other idea how to build repo1 and build then repo2 or at least how to get access to multiple repositories without having a user key?