Executing an Automation

In this use case, we will cover a scenario where, if a user publishes an entry in Contentstack, Automations should be able to deploy the selected GitHub repository on Netlify immediately. And, every time you update an entry, the Automation will redeploy the repository on Netlify.

Let's break this scenario to see what must be the trigger event and the consequent action required to execute the Automation:

  1. Set Up the Contentstack “Entry Publish” Trigger Event: This trigger event is activated whenever a Contentstack entry of a particular stack is published, and in turn it activates the Automation.
  2. Set Up the Netlify “Deploy Site” Action: Once the above event triggers the Automation, it will deploy your set GitHub repository (for e.g., a starter app website) to Netlify. Further, any updates to the entry content will invoke the “Entry Publish” trigger event and automatically redeploy your website on Netlify.

The steps to set up the Automation are as follows:

  1. Create an Automation
  2. Set Up the Contentstack Trigger Event
  3. Set Up your Netlify Action Connector
  4. Test out the Automation

Let’s look at the setup in detail.

  1. Create an Automation

    To create an Automation, perform the steps given below:

    1. Log in to your Contentstack account and click on the “Automations” icon.
    2. Click on + New Project and provide the required details to create a new project.
    3. Click on + New Automation to add the steps required to configure automations.
  2. Next, let’s look at the steps to set up the trigger event.

  3. Set Up the Contentstack Trigger Event

    1. Click on Configure Trigger and select the Contentstack connector.
      Select-Contentstack-Trigger.png
    2. Add your Contentstack account. For more information, refer to the Contentstack Trigger documentation.
    3. Once done, select Entry Published from the list of trigger events and define the rest of the steps needed to set up the trigger (refer steps 2 to 11 in Entry Trigger) under the Contentstack Trigger section.
      Configure-Contentstack-Trigger.png

    4. Click on Test Trigger to execute and test the trigger that you configured.

  4. Set Up your Netlify Action Connector

    Let’s configure the Netlify Action connector.

    1. In the Configure Action section, select the Netlify connector.
      Select-Netlify-Action.png
    2. Select the Deploy site action.
      Select-Action-For-Netlify.png

    3. In the Configure Action tab, click on + Add New Account to add your Netlify account.
      Add-New-Netlofy-Account.png
    4. To add your Netlify account, refer to the Netlify Connector document.
    5. Click on the Site ID text box and select an ID from the LOOKUP drop-down.

      The Site ID is a unique identifier given to a project configured in Netlify. You can choose the desired project for which you want to configure the Netlify connector.Netlify-Select-SiteID.png

    6. Once done, click on Proceed.
      Proceed-To-Test-Netlify-Action.png

    7. Click on the Test Action button to test the configured action connector.
      Test-Action.png

    8. Once the execution is successful, you will get the final output as seen in the screenshot in step 10.

      This should initiate the build in your Netlify console. Navigate to your Netlify console and verify it. If you see the build initiated, that means the automation works successfully.
    9. Navigate back to your automation set up page, and click on Save and Exit to finish setting up the action.
      Save-Exit-Action.png

    This sets up the Netlify action connector.

  5. Test out the Automation

    Now, it’s time to test out your automation. To do so, perform the steps given below:

    1. Go to Contentstack and create an entry for the content type that you selected in your trigger event in Step 2
    2. Once done, publish the entry. This should trigger your Automation.
    3. Now, navigate to Netlify and log in to your Netlify console. 
    4. Check the Deploy log window to see whether Automation has initiated the build. You should see the following output:
      Deploy_Log.png

Was this article helpful?

Thanks for your feedbackSmile-icon

More articles in "Quickstart"

On This Page

^