CA
Crawlee & Apify•10mo ago
afraid-scarlet

Deployment metadata

Hi, I'm trying to understand how to bump the version of my actors when deploying programatically. On the one hand it's not possible using the API (https://docs.apify.com/platform/actors/development/actor-definition/actor-json#reference)
Actor name, version, buildTag, and environmentVariables are currently only used when you deploy your Actor using the Apify CLI and not when deployed, for example, via GitHub integration. There, it serves for informative purposes only.
On the other hand you recommend not using the CLI for deployment (https://docs.apify.com/academy/deploying-your-code/deploying#with-apify-cli)
The apify push command should only really be used for quickly pushing and testing Actors on the platform during development. If you are ready to make your Actor public, use a Git repository instead, as you will reap the benefits of using Git and others will be able to contribute to the project.
Creating a new build increments the PATCH version, but i also want to set the MAJOR and MINOR versions. Is there a way I'm missing?
6 Replies
Hall
Hall•10mo ago
Post created!
This post has been synced with the Apify community site and will be indexed by search engines
Marco
Marco•10mo ago
Hello! Actor version and build version are two different things. See: - Actor version: https://docs.apify.com/platform/actors/development/actor-definition/actor-json#reference - Build version: https://docs.apify.com/platform/actors/development/builds-and-runs/builds#versioning You can specify a custom major and minor build version when you "fork" your build on the platform, from the Source tab. Every build automatically increases the patch version: this behavior cannot be customized. On the other hand, you are free to manage the actor version as you prefer.
Builds | Platform | Apify Documentation
Learn Apify's conventions for actor-build number and how to use a specific Actor version in a run. Understand an Actor's lifecycle and manage its cache.
actor.json | Platform | Apify Documentation
Learn how to write the main Actor config in the .actor/actor.json file.
afraid-scarlet
afraid-scarletOP•10mo ago
Hey @Marco , thanks for your answer. So it seems what i want is in API: - create a new version: https://docs.apify.com/api/v2#tag/ActorsVersion-collection/operation/act_versions_post - build it: https://docs.apify.com/api/v2#tag/ActorsBuild-collection/operation/act_builds_post I guess there is no simpler way to bump the version and rebuild automatically, keeping the same env variables and so on? (this endpoint requires passing everything again in the payload
Marco
Marco•10mo ago
Yes, it seems to me like the best way to to do this through API.
afraid-scarlet
afraid-scarletOP•10mo ago
ok it's convoluted but i've made it work, thanks for your support 🫡
MEE6
MEE6•10mo ago
@Jerome just advanced to level 3! Thanks for your contributions! 🎉

Did you find this page helpful?