Back to Deployer

How to Deploy a Statamic Project

docs/recipe/statamic.md

8.0.37.1 KB
Original Source
<!-- DO NOT EDIT THIS FILE! --> <!-- Instead edit recipe/statamic.php --> <!-- Then run bin/docgen -->

How to Deploy a Statamic Project

php
require 'recipe/statamic.php';

Source

Deployer is a free and open source deployment tool written in PHP. It helps you to deploy your Statamic application to a server. It is very easy to use and has a lot of features.

Three main features of Deployer are:

  • Provisioning - provision your server for you.
  • Zero downtime deployment - deploy your application without a downtime.
  • Rollbacks - rollback your application to a previous version, if something goes wrong.

Additionally, Deployer has a lot of other features, like:

  • Easy to use - Deployer is very easy to use. It has a simple and intuitive syntax.
  • Fast - Deployer is very fast. It uses parallel connections to deploy your application.
  • Secure - Deployer uses SSH to connect to your server.
  • Supports all major PHP frameworks - Deployer supports all major PHP frameworks.

You can read more about Deployer in Getting Started.

The deploy task of Statamic consists of:

The statamic recipe is based on the laravel recipe.

Configuration

statamic_version

Source

php
$result = run('{{bin/php}} {{release_or_current_path}}/please --version');
preg_match_all('/(\d+\.?)+/', $result, $matches);
return $matches[0][0] ?? 'unknown';

Tasks

statamic:addons:discover {#statamic-addons-discover}

Source

Rebuilds the cached addon package manifest.

Addons

statamic:assets:generate-presets {#statamic-assets-generate-presets}

Source

Generates asset preset manipulations.

Assets

statamic:assets:meta {#statamic-assets-meta}

Source

Generates asset metadata files.

statamic:git:commit {#statamic-git-commit}

Source

Git add and commit tracked content.

Git

statamic:glide:clear {#statamic-glide-clear}

Source

Clears the Glide image cache.

Glide

statamic:responsive:generate {#statamic-responsive-generate}

Source

Generates responsive images.

Responsive Images (not in the core)

statamic:responsive:regenerate {#statamic-responsive-regenerate}

Source

Regenerate responsive images.

statamic:search:insert {#statamic-search-insert}

Source

Inserts an item into its search indexes.

Search

statamic:search:update {#statamic-search-update}

Source

Update a search index.

statamic:stache:clear {#statamic-stache-clear}

Source

Clears the "Stache" cache.

Stache

statamic:stache:doctor {#statamic-stache-doctor}

Source

Diagnose any problems with the Stache.

statamic:stache:refresh {#statamic-stache-refresh}

Source

Clears and rebuild the "Stache" cache.

statamic:stache:warm {#statamic-stache-warm}

Source

Builds the "Stache" cache.

statamic:static:clear {#statamic-static-clear}

Source

Clears the static page cache.

Static

statamic:static:warm {#statamic-static-warm}

Source

Warms the static cache by visiting all URLs.

statamic:support:details {#statamic-support-details}

Source

Outputs details helpful for support requests.

Support

statamic:updates:run {#statamic-updates-run}

Source

Runs update scripts from specific version.

Updated

deploy {#deploy}

Source

Deploys your project.

Main Deploy Script for Statamic, which will overwrite the Laravel default.

This task is group task which contains next tasks: