Watch our video guide to help you follow the steps below.
GitHub
1. Link your Git repo with Apify
To kick off, go to Actors in Apify Console and click Develop new
in the top right corner. Then click Link Git repository
. Select your Git provider, and in our case, we're going to start with GitHub.
A window will appear asking for your GitHub authentication. Once authenticated, click add GitHub account
to install Apify on your personal GitHub account. Once installed, you'll see your GitHub repositories.
You also have the ability to switch between authorized users and organizations.
2. Select your repository
If the repository you want to source code from is not visible on the first page, you can utilize the search function to locate it.
If you are unable to locate the desired repository, it is possible that Apify still doesn’t have access to this particular repo. To fix it, click on Adjust GitHub App permissions
to manage your GitHub permissions.
From there, you have two options: you can grant Apify access to all the repositories in your GitHub account, including private ones, or you can choose specific repositories to give Apify access to.
After selecting your repository, you have the option to specify the branch and folder from which the code should be retrieved.
3. Build your Actor
Once you have finalized your configuration, the next step is to proceed with building your Actor.
Wait for the build to finish, and that’s it! Your Actor is ready to run.
In the Code
tab, you have the option to define the build settings for your Actor. By default, it is set to Manual builds
, which requires you to manually build the Actor with the updated version of the code each time you push new code to your repository.
Alternatively, you can choose to change the build settings to Automatic builds
. This option will automatically build the Actor and update it with the latest version whenever you push new code to the repo associated with the Actor.
GitLab, BitBucket, and other Git providers
We've covered getting code from GitHub. To get your code from GitLab and BitBucket or any other Git provider, just provide the Git URL for the desired repository, and you can create an Actor from it by clicking link Actor
.
After that, as with GitHub, you have the option to specify a branch and folder from the provided repository, and then you have to build your Actor.