DEV Community

Cover image for How to deploy new versions of your Strapi app with Microtica: Tips & Tricks
Marija N. for Microtica

Posted on • Originally published at microtica.com

How to deploy new versions of your Strapi app with Microtica: Tips & Tricks

Strapi is an open-source, headless CMS, while Microtica offers cloud-based infrastructure delivery and management, simplifying application deployments. Both prioritize scalability, performance, and deployment ease, advocating for efficient development processes and content delivery.

In this blog, we will briefly overview the best practices for deploying new versions of Strapi with Microtica. We’ll cover key strategies for smooth deployment, avoiding common mistakes, and handling multiple environments like dev, test, and prod. Additionally, we’ll discuss how our platform can assist with version control and answer some frequently asked questions about deploying new Strapi versions with Microtica.

How to Deploy New Strapi Versions?

When deploying your application with Microtica for the first time, you can use the ready-made Strapi Serverless Template, and either create a new application in your provided git repository or import an existing application if you’re migrating to AWS.

Microtica’s template pre-configures a fully managed cloud environment for Strapi, based on serverless Fargate.

Automated Deployment with Git Versioning

One of the key advantages of using Microtica is its ability to automate the deployment workflow. Set up a pipeline that integrates with your version control system (e.g., GitHub) to automatically trigger deployments whenever there are new Strapi versions or changes in your application. This ensures consistency and reduces the chances of human error during the deployment process.

1.Branching: When you create your application using the template, you can choose the branch from which you want to deploy your application. This is important because you might have different branches for different environments or feature previews. Every git push to that branch triggers a seamless automatic deployment of the new version and code changes.

Configure template in Microtica

2. Create a Microtica pipeline: If you create the Strapi application using the template, you have a preconfigured *microtica.yaml *file with a defined Microtica pipeline that includes stages for building, testing, and deploying your application. You can easily configure these stages in your Git repository and Microtica will automate the entire deployment lifecycle.

3. Versioning and tagging: Implement versioning and tagging mechanisms for your Strapi application within your version control system. This ensures that you can easily track changes, rollback to previous versions if needed, and maintain a clear history of your deployments. Additionally, you can customize this feature by defining filepath patterns that enable you to automatically trigger your builds and deployments only when specific files change.

Manual Deployments of Your Strapi App

Microtica also provides the ability to deploy applications manually by triggering the deployment pipeline directly from the user interface (UI). While manual deployments can be useful in certain scenarios, we strongly encourage adopting automated deployment practices.

You can manually trigger deployments after testing and verifying the new version in a separate environment. This approach can offer more control over the rollout process, giving you a chance to rollback if needed.

Trigger deployments in Microtica

The Hybrid Approach for Strapi Update

A third common approach that our customers seem to find useful, is to combine automated deployments for minor updates with manual rollouts for major Strapi versions. This method leverages the convenience of automatic updates for minor bug fixes and stability improvements while providing control for significant feature changes.

Handling Multiple Environments When Deploying Strapi on AWS

Strapi applications often have different requirements and configurations for development, testing, and production environments. Microtica provides a robust solution for managing these environments efficiently.

Each project in Microtica consists of multiple environments, which are isolated from each other, allowing teams to integrate different code bases with each environment. You can quickly deploy new code versions, test them, and rollback if necessary.

Environment-specific Configurations — Environment Variables

Leverage Microtica’s support for environment variables to configure specific settings for each environment. For example, set up different database connections, cache configurations, or API endpoints for each environment, ensuring a smooth transition from development to production.

All environment variables can be configured using Microtica’s user interface, eliminating the need for manual coding. This makes setting up and switching between environments faster and more reliable.

Environment variables configuration

Microtica enables teams to quickly and easily create and destroy environments as needed. It also allows them to monitor and track performance in real-time, create alarms, and receive application alerts. This helps teams to quickly identify and address any issues that may arise.

Immutable Infrastructure to Streamline Strapi Deployments

By adopting Microtica for your Stapi application delivery on AWS, you’re also adopting the immutable infrastructure approach. The necessary infrastructure is treated as code, which reduces the chances of environment drift and ensures that your application behaves predictably across different stages.

Microtica supports popular IaC tools, such as AWS CloudFormation, enabling you to manage infrastructure configurations in a version-controlled manner.

Beyond the Basics — A Seamless Workflow

  • Continuous testing: Integrate continuous testing into your Microtica pipeline to catch potential issues early in the deployment process. Automated tests can help validate the functionality and performance of your Strapi application across various environments.

  • Monitoring and logging: The platform offers real-time monitoring and logging mechanisms into your application’s performance, CPU, and memory usage. The new version 3.0 will offer enhanced monitoring tools, like dashboards with crucial metrics, incidents, and alert systems. This ensures that you can proactively identify and address issues in your application at any time.

  • Scalability: Let Microtica do the heavy lifting with its built-in autoscaling feature. Define target metrics and thresholds, and Microtica will automatically adjust your Strapi instances based on real-time demand, taking the guesswork out of scaling.

  • Resource optimization: Monitor your resource usage to identify underutilized instances and optimize your costs. Microtica provides detailed insights to help you make informed decisions about your scaling strategy.

Conclusion

Deploying new versions of Strapi with Microtica offers a streamlined and automated process, allowing for efficient management of multiple environments. By following best practices such as automated workflows, environment-specific configurations, and continuous testing, you can ensure a reliable and scalable deployment pipeline for your applications. Microtica’s features empower developers to focus on building and enhancing their Strapi projects, confident in the knowledge that the deployment process is both efficient and robust.

Additional documentation resources:

Top comments (0)