Directus Extension Publish Netlify screenshot

Directus Extension Publish Netlify

Author Avatar Theme by Dwaring87
Updated: 27 Oct 2024
16 Stars

A Directus v9 extension (module & endpoints) for initiating a Netlify build from within the Directus app.

Categories

Overview:

The Directus Extension: dwaring87-publish-netlify is a v9 extension for the Directus app. It includes a frontend app module and backend API endpoints that allow users to manage builds and deploys of a Netlify site. The extension is designed to make it easier for admin users to initiate a Netlify build and manage the published deploy directly from within the Directus app.

Features:

  • Initiates a build of a static site generator (e.g., Gatsby, Gridsome) on Netlify after data in Directus has been updated.
  • Keeps track of when the site was last updated and detects any data updates in Directus since the last update.
  • Allows users to start a new Netlify build and manage the published deploy directly from within Directus.

Installation:

To install the Directus Extension: dwaring87-publish-netlify, follow these steps:

  1. Install the node dependencies by running npm install in the project’s root directory.
  2. Build the app module from source using Rollup. Run the included build script using npm run build.
  3. Deploy the built app module and API endpoint to the Directus extensions directory.
    • Set the DIRECTUS_EXTENSIONS_PATH environment variable to the path of the Directus extensions directory.
    • Use the included deploy script to copy the appropriate files to the extensions directory.
      • Copy ./config.js to /directus/extensions/endpoints/dwaring87-publish-netlify/config.js
      • Copy ./directus-endpoint-publish-netlify/src/index.js to /directus/extensions/endpoints/dwaring87-publish-netlify/index.js
      • Copy ./directus-module-publish-netlify/dist/index.js to /directus/extensions/modules/dwaring87-publish-netlify/index.js

Summary:

The Directus Extension: dwaring87-publish-netlify is a powerful tool for managing builds and deploys of a Netlify site within the Directus app. It provides a user-friendly interface for initiating builds, keeping track of updates, and managing deployed sites. The installation process involves installing node dependencies, building the app module, and deploying the module and API endpoints to the Directus extensions directory. With advanced configuration options available, the extension can be customized to fit specific needs.