Is it possible to copy a deployment from one site to another?

Hi folks!

We are building our Gatsby site with Gatsby Cloud and want to deploy to Netlify (we currently don’t do this, but want to). As we have some problem with the consistency of the Gatsby Cloud builds, we are thinking about a continous integration pipeline with Netlify as hosting, Gatsby Cloud for builds and Github Actions for the end 2 end tests and Q to Production deployments:

  1. Create a production build on Gatsby Cloud and deploy to a Netlify Q site.
  2. Run some integration and end 2 end test on that Q Stage. We would trigger the end 2 end test with a successful deployment webhook from Netlify.
  3. If successful, download the deployment from the Netlify Q site and copy them over the the Netlify Production site. This is the part where we are unsure if that works.

I looked up the Netlify CLI docs, but couldn’t find an endpoint to do the Netlify deployment download. Am I missing something or is this not possible? Any other feedback to this pipeline is also welcome :slight_smile:

Best regards,
Fabian

hey @feedm3, interesting plan! Unfortunately, at the moment it is not possible to trigger a download via the CLI.

Is there are specific reason why you want to keep the build process on gatsby cloud and not let Netlify build your sites instead?

Hi @perry! We want to do automated production deployments. Therefore, we run some integrations tests on the finished build output before we deploy everything to production. We do this to validate if all our new features are working on production data, as well as our gatsby build output is sometimes broken and should not be deployed then (due to flaky API/CMS in conjunction with the gatsby cache).

Is there some way to copy one deployment to a different project? We are currently doing this on AWS with aws s3 sync bucket-1 bucket-2, where the build output first gets deployed to bucket-1, then an integration tests runs on this bucket and finally the bucket-1 gets copied to bucket-2.

Hi, @feedm3. There are several possible approaches.

  1. Build and deploy at Netlify but don’t publish by locking the current deploy. After the checks are completed, only then publish the deploy.
  2. Do your build in a local or third-party build system and then use the Netlify CLI tool to manually deploy the build in the third-party.
  3. Build and deploy one one site and then download and manually upload that deploy to the production site.

For option 3 above, you can download the deploy using the button shown in the screenshot above.

Then you can drag and drop that zip file into the deploy panel for the production site. However, the first two solutions are much easier to automate (for example, endpoints exist to publish deploys using just the API).

​Please let us know if there are other questions about this.

1 Like