Cloud Platform supports integration with external continuous integration and continuous delivery (CI/CD) tooling. This integration enables your team to use an existing DevOps toolchain, such as GitHub Actions or GitLab CI/CD, to build, test, and deploy applications to Cloud Platform environments.
To replace separate deployment tooling, an external CI/CD pipeline builds a production-ready Drupal artifact. The pipeline pushes the artifact to the Cloud Platform Git repository with Acquia CLI acli push:artifact and triggers an automated code switch with acli api:environments:code-switch. Post-deployment Drupal tasks, such as database updates, configuration imports, and cache clears, run on Cloud Platform through server-side cloud hooks.
This document describes only the Acquia-specific pipeline setup. The integration does not change your current test and code-quality jobs. Run these jobs before you do the deployment steps. First, do the steps in Part 1. Then, do the steps in Part 2 for GitHub Actions, or Part 3 for GitLab CI/CD.
To use an AI agent to do this setup, refer to Automated setup with the Acquia agent skill at the end of this page.
Architecture
To integrate external CI/CD with Cloud Platform, understand the following architecture:
Source Control and CI: Developers push code to a source repository, such as GitHub or GitLab. This action triggers tests, code format reviews, and quality checks in a CI runner.
Artifact Generation: A CI runner uses Acquia CLI acli push:artifact to run composer install, compile required front-end assets, sanitize files, and package vendor dependencies into a deployable artifact.
Artifact Deployment: The artifact transfers to Acquia Git and receives an immutable release tag, for example, tags/build-<id>.
Environment
Code Switch: Acquia CLI invokes Cloud Platform API to switch the target environment, such as dev, test, or prod, to the new release tag.
Drupal Orchestration: The post-code-deploy cloud hook of Cloud Platform runs Drush commands, such as updatedb, config:import, and cache:rebuild, on the server.
Prerequisites
Before you configure an external CI/CD pipeline, ensure that you have the following requirements:
Cloud Platform
Application
and Permissions: An active application with , , and environments. You must have a user account with SSH push and API token generation permissions.
Note
This setup does not apply to Multi-Experience Operations codebases. These codebases deploy through centralized codebase references instead of per-application Git repositories. To verify, run the following command:
If the command returns a codebase reference, this guide does not apply.
Part 1: Acquia Cloud Platform One-Time Setup
You must complete four setup steps before you configure a CI/CD provider.
Step 1: Generate an Acquia API Token
To generate an Acquia API Token:
In the Cloud Platform user interface, navigate to Account Settings and select API Tokens. For more information, refer to Cloud Platform API v2 authentication.
Click Create Token. Enter a descriptive label, for example, External CI/CD Token.
Copy the API Key and API Secret.
Authenticate the local Acquia CLI session with the following command:
Open each environment in the Cloud Platform user interface. The ID is the last part of the URL ([https://cloud.acquia.com/a/environments/](https://cloud.acquia.com/a/environments/)<environmentId>). It appears like this, 12345-abcdef01-2345-6789-abcd-ef0123456789.
The Git URL has the form <sitename>@svn-XXXXX.prod.hosting.acquia.com:<sitename>.git.
Step 4: Add the post-code-deploy cloud hook
Cloud Platform runs scripts from your repository's hooks/ directory at defined points in the deployment lifecycle. Cloud hooks run automated tasks on the server after you deploy code. Create a hook script at hooks/common/post-code-deploy/drupal-deploy.sh. To add the post-code-deploy cloud hook:
#!/bin/sh
#
# Cloud Platform post-code-deploy hook: runs Drupal deployment operations
# after code is deployed to any environment.
#
# Arguments supplied by Cloud Platform:
# $1 = site name, $2 = target environment.
site="$1"
target_env="$2"
set -ev
drush @$site.$target_env updatedb --yes
drush @$site.$target_env config:import --yes
drush @$site.$target_env cache:rebuild
set +v
Run the following commands to make the script executable and commit the script to the repository:
Because the hook is in the hooks/common/ directory, it runs on every environment. To vary behavior per environment, place scripts in the hooks/dev/, hooks/test/, or hooks/prod/ directories instead. For more information, refer to Automating with Cloud Hooks.
Deploy branch names
A built artifact lands on Acquia Git in a dedicated deploy branch. Your source repository stays on GitHub or GitLab. To migrate from Acquia Pipelines, you must maintain the Acquia branch name convention so that the deploy branch matches your existing environment configuration:
Source branch
Acquia deploy branch
main
pipelines-build-main
master
pipelines-build-master
The prefix must be pipelines-build- in plural form. A singular prefix of pipeline-build- creates a different branch that does not match previous Acquia Pipelines deployments.
Part 2: GitHub Actions
Prerequisite: Complete Part 1.
Step 5: Add repository secrets
Navigate to the repository.
Select Settings.
Select Secretsand variables.
Select Actions.
Select New repository secret.
Add all secrets at the repository level instead of the environment level. Every target environment uses the same Git remote and Application Programming Interface, known as API, credentials.
Secret name
Required
Value
ACQUIA_CLI_KEY
Yes
API token key from Step 1
ACQUIA_CLI_SECRET
Yes
API token secret from Step 1
ACQUIA_SSH_PRIVATE_KEY
Yes
Full contents of ~/.ssh/acquia_ci_cd, including the BEGIN/END lines
ACQUIA_SSH_PASSPHRASE
No
Passphrase of the key— omit this secret, if you have not set the passphrase
ACQUIA_GIT_URL
Yes
Acquia Git URL from Step 3
ACQUIA_DEV_ENV_ID
Yes
dev environment ID from Step 3
ACQUIA_TEST_ENV_ID
Yes
test environment ID from Step 3
ACQUIA_PROD_ENV_ID
Yes
prod environment ID from Step 3
To set the secrets from the command line instead of the UI, run the following commands:
gh secret set ACQUIA_SSH_PRIVATE_KEY < ~/.ssh/acquia_ci_cd
gh secret set ACQUIA_CLI_KEY --body "<key>"
Step 6: Add Acquia deploy steps to the workflow
Add the following workflow as .github/workflows/acquia-deploy.yml or copy the steps into an existing workflow.
The workflow performs the following three actions:
Build and push the artifact: The acli push:artifact command runs composer install, removes sensitive files, and commits vendor/ and Drupal scaffold files even though the source repository gitignores them. It pushes the result to the deploy branch and to an immutable tag.
Deploy to dev: The acli api:environments:code-switch command points the environment at that tag. This action triggers the post-code-deploy hook on Cloud Platform.
Promote the same tag to test and prod: Because the tag is immutable, promotion is a code switch with no rebuild. Test and prod receive exactly the bytes validated on dev.
name: Deploy to Acquia
on:
push:
branches: [main]
env:
RELEASE_TAG: build-${{ github.run_id }}
jobs:
build-and-deploy-dev:
runs-on: ubuntu-24.04
environment: acquia-dev
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer:v2
# Load the CI SSH key so acli can push to the Acquia Git repository
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.ACQUIA_SSH_PRIVATE_KEY }}
ssh-passphrase: ${{ secrets.ACQUIA_SSH_PASSPHRASE }}
- name: Trust the Acquia Git host
run: |
mkdir -p ~/.ssh
GIT_HOST=$(echo "${{ secrets.ACQUIA_GIT_URL }}" | sed 's/.*@//; s/:.*//')
ssh-keyscan -H "$GIT_HOST" >> ~/.ssh/known_hosts
- name: Install and authenticate Acquia CLI
run: |
curl -sSL https://github.com/acquia/cli/releases/latest/download/acli.phar \
-o /usr/local/bin/acli
chmod +x /usr/local/bin/acli
acli auth:login \
--key="${{ secrets.ACQUIA_CLI_KEY }}" \
--secret="${{ secrets.ACQUIA_CLI_SECRET }}" \
--no-interaction
- name: Build and push the artifact to Acquia Git
run: |
acli push:artifact "${{ secrets.ACQUIA_DEV_ENV_ID }}" \
--destination-git-branch="pipelines-build-${{ github.ref_name }}" \
--destination-git-tag="$RELEASE_TAG" \
--no-interaction
# The reference is a positional argument, never --branch=.
# Tags must be prefixed with tags/. --task-wait blocks until the deploy finishes.
- name: Deploy to dev
run: |
acli api:environments:code-switch "${{ secrets.ACQUIA_DEV_ENV_ID }}" \
"tags/$RELEASE_TAG" --task-wait --no-interaction
deploy-test:
needs: build-and-deploy-dev
runs-on: ubuntu-24.04
# Add required reviewers to this GitHub Environment to gate the job on approval
environment: acquia-test
steps:
- name: Install and authenticate Acquia CLI
run: |
curl -sSL https://github.com/acquia/cli/releases/latest/download/acli.phar \
-o /usr/local/bin/acli
chmod +x /usr/local/bin/acli
acli auth:login \
--key="${{ secrets.ACQUIA_CLI_KEY }}" \
--secret="${{ secrets.ACQUIA_CLI_SECRET }}" \
--no-interaction
- name: Promote the release to test
run: |
acli api:environments:code-switch "${{ secrets.ACQUIA_TEST_ENV_ID }}" \
"tags/$RELEASE_TAG" --task-wait --no-interaction
deploy-prod:
needs: deploy-test
runs-on: ubuntu-24.04
environment: acquia-prod
steps:
- name: Install and authenticate Acquia CLI
run: |
curl -sSL https://github.com/acquia/cli/releases/latest/download/acli.phar \
-o /usr/local/bin/acli
chmod +x /usr/local/bin/acli
acli auth:login \
--key="${{ secrets.ACQUIA_CLI_KEY }}" \
--secret="${{ secrets.ACQUIA_CLI_SECRET }}" \
--no-interaction
- name: Promote the release to production
run: |
acli api:environments:code-switch "${{ secrets.ACQUIA_PROD_ENV_ID }}" \
"tags/$RELEASE_TAG" --task-wait --no-interaction
To run existing tests first, add a needs: requirement on the Continuous Integration, known as CI, job. If the theme compiles front-end assets, register the build as a post-install-cmd script in composer.json. The acli push:artifact command runs Composer scripts as part of the build. Therefore, no additional pipeline step is required.
Part 3: GitLab CI/CD
Prerequisite: Complete Part 1.
Step 5: Add CI/CD variables
Navigate to the project.
Select Settings.
Select CI/CD.
Select Variables.
Add the following variables. Mark each one Masked, and Protected if the default branch is protected.
Variable name
Required
Value
ACQUIA_CLI_KEY
Yes
API token key from Step 1
ACQUIA_CLI_SECRET
Yes
API token secret from Step 1
ACQUIA_SSH_PRIVATE_KEY
Yes
Full contents of ~/.ssh/acquia_ci_cd, including the BEGIN/END lines
ACQUIA_GIT_URL
Yes
Acquia Git URL from Step 3
ACQUIA_DEV_ENV_ID
Yes
dev environment ID from Step 3
ACQUIA_TEST_ENV_ID
Yes
test environment ID from Step 3
ACQUIA_PROD_ENV_ID
Yes
prod environment ID from Step 3
To set the variables from the command line instead of the UI, execute the following command:
glab variable set ACQUIA_CLI_KEY "<key>" --masked
If acli auth:login fails only on some branches, verify whether the variables are marked Protected while the branch is not.
Step 6: Add Acquia deploy jobs to the pipeline
Add the following jobs to .gitlab-ci.yml, alongside existing test and quality stages.
The jobs perform the following three actions:
Build and push the artifact. The acli push:artifact command runs composer install, removes sensitive files, and commits vendor/ and Drupal scaffold files even though the source repository ignores them. It pushes the result to the deploy branch and to an immutable tag.
Deploy to dev. The acli api:environments:code-switch command points the environment at that tag. This action triggers the post-code-deploy hook on Cloud Platform.
Promote the same tag to test and prod. Because the tag is immutable, promotion is a code switch with no rebuild. Test and prod receive exactly the bytes validated on dev.
If the theme compiles front-end assets, register the build as a post-install-cmd script in composer.json. The acli push:artifact command runs Composer scripts as part of the build. Therefore, no additional pipeline step is required.
Automated setup with Acquia agent skill
Acquia publishes an Agent Skill that performs this entire setup through an Artificial Intelligence, known as AI, coding agent such as Claude Code, GitHub Copilot, Cursor, Gemini command-line tool, known as CLI, or OpenAI Codex. The skill is playbooks/setup-external-ci-cd from the acquia/acquia-skills repository.
Install the skill
Run the following command in the project directory. The npx skills CLI detects the active AI tool and installs the skill files in the correct location:
npx skills add acquia/acquia-skills
To install the playbook skills only, run the following command:
After you install the skill, ask the agent in plain language. For example, set up an external CI/CD with GitHub Actions for my Acquia application so it pushes to main build and deploy to dev, then promotes the same release to test and prod.
The agent performs the following actions:
Verifies that acli is installed and authenticated, and runs acli auth:login if necessary.
Confirms the application is a supported Cloud Platform application and not an MEO codebase.
Resolves the application UUID, Acquia Git URL, and dev, test, and prod environment IDs.
Generates a dedicated SSH key pair, registers the key with Cloud Platform, and waits for propagation.
Creates a scoped API token.
Writes the pipeline configuration and the post-code-deploy hook into the repository.
Sets the repository secrets through GitHub CLI (gh) or GitLab CLI (glab).
Review the changes it made before you commit:
git status
git add .github hooks # or .gitlab-ci.yml hooks
git commit -m "Add Acquia CI/CD configuration"
Update the skill with the npx skills update acquia/acquia-skills command.
Support boundary
Acquia supports the integration surface between the CI/CD tool and Cloud Platform. This includes SSH and Git access, Acquia CLI, Cloud Platform API, and Cloud Platform hooks. You and the external CI/CD provider own the configuration, availability, and behavior of the external CI/CD provider. Teams without an existing CI/CD toolchain must use built-in tooling, such as Code Studio, as a starting point. Migrate to external tooling later with this guide.
Configuring External CI/CD for Cloud Platform
Cloud Platform supports integration with external continuous integration and continuous delivery (CI/CD) tooling. This integration enables your team to use an existing DevOps toolchain, such as GitHub Actions or GitLab CI/CD, to build, test, and deploy applications to Cloud Platform environments.
To replace separate deployment tooling, an external CI/CD pipeline builds a production-ready Drupal artifact. The pipeline pushes the artifact to the Cloud Platform Git repository with Acquia CLI acli push:artifact and triggers an automated code switch with acli api:environments:code-switch. Post-deployment Drupal tasks, such as database updates, configuration imports, and cache clears, run on Cloud Platform through server-side cloud hooks.
This document describes only the Acquia-specific pipeline setup. The integration does not change your current test and code-quality jobs. Run these jobs before you do the deployment steps. First, do the steps in Part 1. Then, do the steps in Part 2 for GitHub Actions, or Part 3 for GitLab CI/CD.
To use an AI agent to do this setup, refer to Automated setup with the Acquia agent skill at the end of this page.
Architecture
To integrate external CI/CD with Cloud Platform, understand the following architecture:
Source Control and CI: Developers push code to a source repository, such as GitHub or GitLab. This action triggers tests, code format reviews, and quality checks in a CI runner.
Artifact Generation: A CI runner uses Acquia CLI acli push:artifact to run composer install, compile required front-end assets, sanitize files, and package vendor dependencies into a deployable artifact.
Artifact Deployment: The artifact transfers to Acquia Git and receives an immutable release tag, for example, tags/build-<id>.
Environment
Code Switch: Acquia CLI invokes Cloud Platform API to switch the target environment, such as dev, test, or prod, to the new release tag.
Drupal Orchestration: The post-code-deploy cloud hook of Cloud Platform runs Drush commands, such as updatedb, config:import, and cache:rebuild, on the server.
Prerequisites
Before you configure an external CI/CD pipeline, ensure that you have the following requirements:
Cloud Platform
Application
and Permissions: An active application with , , and environments. You must have a user account with SSH push and API token generation permissions.
Note
This setup does not apply to Multi-Experience Operations codebases. These codebases deploy through centralized codebase references instead of per-application Git repositories. To verify, run the following command:
If the command returns a codebase reference, this guide does not apply.
Part 1: Acquia Cloud Platform One-Time Setup
You must complete four setup steps before you configure a CI/CD provider.
Step 1: Generate an Acquia API Token
To generate an Acquia API Token:
In the Cloud Platform user interface, navigate to Account Settings and select API Tokens. For more information, refer to Cloud Platform API v2 authentication.
Click Create Token. Enter a descriptive label, for example, External CI/CD Token.
Copy the API Key and API Secret.
Authenticate the local Acquia CLI session with the following command:
Open each environment in the Cloud Platform user interface. The ID is the last part of the URL ([https://cloud.acquia.com/a/environments/](https://cloud.acquia.com/a/environments/)<environmentId>). It appears like this, 12345-abcdef01-2345-6789-abcd-ef0123456789.
The Git URL has the form <sitename>@svn-XXXXX.prod.hosting.acquia.com:<sitename>.git.
Step 4: Add the post-code-deploy cloud hook
Cloud Platform runs scripts from your repository's hooks/ directory at defined points in the deployment lifecycle. Cloud hooks run automated tasks on the server after you deploy code. Create a hook script at hooks/common/post-code-deploy/drupal-deploy.sh. To add the post-code-deploy cloud hook:
#!/bin/sh
#
# Cloud Platform post-code-deploy hook: runs Drupal deployment operations
# after code is deployed to any environment.
#
# Arguments supplied by Cloud Platform:
# $1 = site name, $2 = target environment.
site="$1"
target_env="$2"
set -ev
drush @$site.$target_env updatedb --yes
drush @$site.$target_env config:import --yes
drush @$site.$target_env cache:rebuild
set +v
Run the following commands to make the script executable and commit the script to the repository:
Because the hook is in the hooks/common/ directory, it runs on every environment. To vary behavior per environment, place scripts in the hooks/dev/, hooks/test/, or hooks/prod/ directories instead. For more information, refer to Automating with Cloud Hooks.
Deploy branch names
A built artifact lands on Acquia Git in a dedicated deploy branch. Your source repository stays on GitHub or GitLab. To migrate from Acquia Pipelines, you must maintain the Acquia branch name convention so that the deploy branch matches your existing environment configuration:
Source branch
Acquia deploy branch
main
pipelines-build-main
master
pipelines-build-master
The prefix must be pipelines-build- in plural form. A singular prefix of pipeline-build- creates a different branch that does not match previous Acquia Pipelines deployments.
Part 2: GitHub Actions
Prerequisite: Complete Part 1.
Step 5: Add repository secrets
Navigate to the repository.
Select Settings.
Select Secretsand variables.
Select Actions.
Select New repository secret.
Add all secrets at the repository level instead of the environment level. Every target environment uses the same Git remote and Application Programming Interface, known as API, credentials.
Secret name
Required
Value
ACQUIA_CLI_KEY
Yes
API token key from Step 1
ACQUIA_CLI_SECRET
Yes
API token secret from Step 1
ACQUIA_SSH_PRIVATE_KEY
Yes
Full contents of ~/.ssh/acquia_ci_cd, including the BEGIN/END lines
ACQUIA_SSH_PASSPHRASE
No
Passphrase of the key— omit this secret, if you have not set the passphrase
ACQUIA_GIT_URL
Yes
Acquia Git URL from Step 3
ACQUIA_DEV_ENV_ID
Yes
dev environment ID from Step 3
ACQUIA_TEST_ENV_ID
Yes
test environment ID from Step 3
ACQUIA_PROD_ENV_ID
Yes
prod environment ID from Step 3
To set the secrets from the command line instead of the UI, run the following commands:
gh secret set ACQUIA_SSH_PRIVATE_KEY < ~/.ssh/acquia_ci_cd
gh secret set ACQUIA_CLI_KEY --body "<key>"
Step 6: Add Acquia deploy steps to the workflow
Add the following workflow as .github/workflows/acquia-deploy.yml or copy the steps into an existing workflow.
The workflow performs the following three actions:
Build and push the artifact: The acli push:artifact command runs composer install, removes sensitive files, and commits vendor/ and Drupal scaffold files even though the source repository gitignores them. It pushes the result to the deploy branch and to an immutable tag.
Deploy to dev: The acli api:environments:code-switch command points the environment at that tag. This action triggers the post-code-deploy hook on Cloud Platform.
Promote the same tag to test and prod: Because the tag is immutable, promotion is a code switch with no rebuild. Test and prod receive exactly the bytes validated on dev.
name: Deploy to Acquia
on:
push:
branches: [main]
env:
RELEASE_TAG: build-${{ github.run_id }}
jobs:
build-and-deploy-dev:
runs-on: ubuntu-24.04
environment: acquia-dev
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer:v2
# Load the CI SSH key so acli can push to the Acquia Git repository
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.ACQUIA_SSH_PRIVATE_KEY }}
ssh-passphrase: ${{ secrets.ACQUIA_SSH_PASSPHRASE }}
- name: Trust the Acquia Git host
run: |
mkdir -p ~/.ssh
GIT_HOST=$(echo "${{ secrets.ACQUIA_GIT_URL }}" | sed 's/.*@//; s/:.*//')
ssh-keyscan -H "$GIT_HOST" >> ~/.ssh/known_hosts
- name: Install and authenticate Acquia CLI
run: |
curl -sSL https://github.com/acquia/cli/releases/latest/download/acli.phar \
-o /usr/local/bin/acli
chmod +x /usr/local/bin/acli
acli auth:login \
--key="${{ secrets.ACQUIA_CLI_KEY }}" \
--secret="${{ secrets.ACQUIA_CLI_SECRET }}" \
--no-interaction
- name: Build and push the artifact to Acquia Git
run: |
acli push:artifact "${{ secrets.ACQUIA_DEV_ENV_ID }}" \
--destination-git-branch="pipelines-build-${{ github.ref_name }}" \
--destination-git-tag="$RELEASE_TAG" \
--no-interaction
# The reference is a positional argument, never --branch=.
# Tags must be prefixed with tags/. --task-wait blocks until the deploy finishes.
- name: Deploy to dev
run: |
acli api:environments:code-switch "${{ secrets.ACQUIA_DEV_ENV_ID }}" \
"tags/$RELEASE_TAG" --task-wait --no-interaction
deploy-test:
needs: build-and-deploy-dev
runs-on: ubuntu-24.04
# Add required reviewers to this GitHub Environment to gate the job on approval
environment: acquia-test
steps:
- name: Install and authenticate Acquia CLI
run: |
curl -sSL https://github.com/acquia/cli/releases/latest/download/acli.phar \
-o /usr/local/bin/acli
chmod +x /usr/local/bin/acli
acli auth:login \
--key="${{ secrets.ACQUIA_CLI_KEY }}" \
--secret="${{ secrets.ACQUIA_CLI_SECRET }}" \
--no-interaction
- name: Promote the release to test
run: |
acli api:environments:code-switch "${{ secrets.ACQUIA_TEST_ENV_ID }}" \
"tags/$RELEASE_TAG" --task-wait --no-interaction
deploy-prod:
needs: deploy-test
runs-on: ubuntu-24.04
environment: acquia-prod
steps:
- name: Install and authenticate Acquia CLI
run: |
curl -sSL https://github.com/acquia/cli/releases/latest/download/acli.phar \
-o /usr/local/bin/acli
chmod +x /usr/local/bin/acli
acli auth:login \
--key="${{ secrets.ACQUIA_CLI_KEY }}" \
--secret="${{ secrets.ACQUIA_CLI_SECRET }}" \
--no-interaction
- name: Promote the release to production
run: |
acli api:environments:code-switch "${{ secrets.ACQUIA_PROD_ENV_ID }}" \
"tags/$RELEASE_TAG" --task-wait --no-interaction
To run existing tests first, add a needs: requirement on the Continuous Integration, known as CI, job. If the theme compiles front-end assets, register the build as a post-install-cmd script in composer.json. The acli push:artifact command runs Composer scripts as part of the build. Therefore, no additional pipeline step is required.
Part 3: GitLab CI/CD
Prerequisite: Complete Part 1.
Step 5: Add CI/CD variables
Navigate to the project.
Select Settings.
Select CI/CD.
Select Variables.
Add the following variables. Mark each one Masked, and Protected if the default branch is protected.
Variable name
Required
Value
ACQUIA_CLI_KEY
Yes
API token key from Step 1
ACQUIA_CLI_SECRET
Yes
API token secret from Step 1
ACQUIA_SSH_PRIVATE_KEY
Yes
Full contents of ~/.ssh/acquia_ci_cd, including the BEGIN/END lines
ACQUIA_GIT_URL
Yes
Acquia Git URL from Step 3
ACQUIA_DEV_ENV_ID
Yes
dev environment ID from Step 3
ACQUIA_TEST_ENV_ID
Yes
test environment ID from Step 3
ACQUIA_PROD_ENV_ID
Yes
prod environment ID from Step 3
To set the variables from the command line instead of the UI, execute the following command:
glab variable set ACQUIA_CLI_KEY "<key>" --masked
If acli auth:login fails only on some branches, verify whether the variables are marked Protected while the branch is not.
Step 6: Add Acquia deploy jobs to the pipeline
Add the following jobs to .gitlab-ci.yml, alongside existing test and quality stages.
The jobs perform the following three actions:
Build and push the artifact. The acli push:artifact command runs composer install, removes sensitive files, and commits vendor/ and Drupal scaffold files even though the source repository ignores them. It pushes the result to the deploy branch and to an immutable tag.
Deploy to dev. The acli api:environments:code-switch command points the environment at that tag. This action triggers the post-code-deploy hook on Cloud Platform.
Promote the same tag to test and prod. Because the tag is immutable, promotion is a code switch with no rebuild. Test and prod receive exactly the bytes validated on dev.
If the theme compiles front-end assets, register the build as a post-install-cmd script in composer.json. The acli push:artifact command runs Composer scripts as part of the build. Therefore, no additional pipeline step is required.
Automated setup with Acquia agent skill
Acquia publishes an Agent Skill that performs this entire setup through an Artificial Intelligence, known as AI, coding agent such as Claude Code, GitHub Copilot, Cursor, Gemini command-line tool, known as CLI, or OpenAI Codex. The skill is playbooks/setup-external-ci-cd from the acquia/acquia-skills repository.
Install the skill
Run the following command in the project directory. The npx skills CLI detects the active AI tool and installs the skill files in the correct location:
npx skills add acquia/acquia-skills
To install the playbook skills only, run the following command:
After you install the skill, ask the agent in plain language. For example, set up an external CI/CD with GitHub Actions for my Acquia application so it pushes to main build and deploy to dev, then promotes the same release to test and prod.
The agent performs the following actions:
Verifies that acli is installed and authenticated, and runs acli auth:login if necessary.
Confirms the application is a supported Cloud Platform application and not an MEO codebase.
Resolves the application UUID, Acquia Git URL, and dev, test, and prod environment IDs.
Generates a dedicated SSH key pair, registers the key with Cloud Platform, and waits for propagation.
Creates a scoped API token.
Writes the pipeline configuration and the post-code-deploy hook into the repository.
Sets the repository secrets through GitHub CLI (gh) or GitLab CLI (glab).
Review the changes it made before you commit:
git status
git add .github hooks # or .gitlab-ci.yml hooks
git commit -m "Add Acquia CI/CD configuration"
Update the skill with the npx skills update acquia/acquia-skills command.
Support boundary
Acquia supports the integration surface between the CI/CD tool and Cloud Platform. This includes SSH and Git access, Acquia CLI, Cloud Platform API, and Cloud Platform hooks. You and the external CI/CD provider own the configuration, availability, and behavior of the external CI/CD provider. Teams without an existing CI/CD toolchain must use built-in tooling, such as Code Studio, as a starting point. Migrate to external tooling later with this guide.
dev
test
prod
SCM Repository Admin Access: Administrative access to a GitHub or GitLab repository to configure CI/CD secrets and variables.
Drupal Codebase: A Composer-managed Drupal codebase that follows the standard docroot/ structure with drush/drush in composer.json.
Local Acquia CLI:Acquia CLI installed on a local machine to perform the one-time configuration steps.
CI Runner Environment: A Linux-based CI runner, for example, Ubuntu, with a PHP version that matches the Cloud Platform environment, Composer v2, Git, and OpenSSH client.
Did not find what you were looking for?
If this content did not answer your questions, try searching or contacting our support team for further assistance.
dev
test
prod
SCM Repository Admin Access: Administrative access to a GitHub or GitLab repository to configure CI/CD secrets and variables.
Drupal Codebase: A Composer-managed Drupal codebase that follows the standard docroot/ structure with drush/drush in composer.json.
Local Acquia CLI:Acquia CLI installed on a local machine to perform the one-time configuration steps.
CI Runner Environment: A Linux-based CI runner, for example, Ubuntu, with a PHP version that matches the Cloud Platform environment, Composer v2, Git, and OpenSSH client.
Did not find what you were looking for?
If this content did not answer your questions, try searching or contacting our support team for further assistance.