In most situations, any build scripts should be run within your CI/CD workflow before the Pagely deployment step is reached. However, in some rare cases, you may find the need to perform actions on the server after a deployment has been run.
In this article, we'll show you how to run additional scripts after a deployment takes place when using one of Pagely's CI/CD integrations.
In this article, we're going to assume that you've already set up the repository that you'll be deploying from and have a basic understanding of how to integrate a deployment step into your workflow. If not, you may want to review our articles on setting up automatic deployments for further information.
As with any workflow or website changes, we recommend testing this on a staging or development environment before performing any actions on your live site.
Creating Post-Deployment Shell Scripts
You can create a script that runs after your deployment occurs by uploading the file directly to the
.pagely/post-deploy folder on the server.
Example Post-Deployment Shell Script File Path
Example Post-Deployment Shell Script
#!/usr/bin/env bash set -eu echo "Hi"
After a deployment occurs, the scripts will be run.