Can anyone share how they setup their CI/CD pipeline with payload

default discord avatar
8 months ago

I'm deploying my first production ready project in a few days. Would love to better optimise my current pipeline

  • default discord avatar
    8 months ago

    Did you made project dockerized?

  • default discord avatar
    8 months ago

    In my most recent deployment, I used DevOps Pipelines deploying to Azure App Services with a MongoDB Atlas instance from the Azure Marketplace.

    I created a new Dockerfile for each environment (dev, qa, uat, production).

    In each Dockerfile, I added a line before the npm install


    (different URL in each reflecting the environment's URL.

    In my Payload Config, I use the environment variable to set the



    Note: This could also have been achieved using .env.<environment-name> files and a single Dockerfile.

    In my DevOps


    file I use variables to determine which Dockerfile to use depending on which git branch triggered the pipeline.

    I build and publish the relevant Dockerfile to an Azure Container Registry.

    The Azure App Services were created as Docker app services and are deployed from the Azure Container Registry, re-deploying via webhook whenever the associated docker image is updated.

    I found this was the only way to get it working in Azure App Services due to the fact that the


    variables need to be present at

    build time

    so they are passed to the admin app, and a bug in Kudu ZipDeploy that breaks


    symlinks preventing any kind of

    npm build

    on the app service itself. (

    npm rebuild

    also doesn't work on app services due to file permissions)

    I've opened a discussion at

    to talk about improving the Payload documentation in regards to production deployments and CI/CD.

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!


Connect with the Payload Community on Discord



Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.