This document describes how to use the Arc XP deploy action in your GitLab CI pipeline.
Add the following to your .gitlab-ci.yml:
include:
- remote: 'https://github.com/code-store-platform/deploy-action/raw/main/gitlab-templates.yml'
deploy_to_arcxp:
extends: .deploy_to_arcxp
before_script:
- npm ci && npm run build # Build your own project
variables:
ARC_XP_ORG_ID: $ARC_XP_ORG_ID
ARC_XP_API_KEY: $ARC_XP_API_KEY
ARC_XP_API_HOSTNAME: $ARC_XP_API_HOSTNAME
BUNDLE_PREFIX: "my-bundle"The template will automatically clone deploy-action if it's not already present (e.g., from a submodule). Your before_script should build your own project artifacts (e.g., dist/fusion-bundle.zip).
The job template uses the following input variables:
- ARC_XP_ORG_ID - The Arc XP organization ID
- ARC_XP_API_KEY - The Arc XP API key (use GitLab masked variables for secrets)
- ARC_XP_API_HOSTNAME - The Arc XP API hostname (e.g.,
api.sandbox.org.arcpublishing.com) - BUNDLE_PREFIX - The prefix for the bundle name used to identify it in Arc XP UI
- PAGEBUILDER_VERSION - The PageBuilder version to deploy with (default:
latest) - ARTIFACT - Path to the artifact to upload (default:
dist/fusion-bundle.zip) - RETRY_COUNT - Number of retry attempts on failure (default:
10) - RETRY_DELAY - Seconds to wait between retries (default:
5) - MINIMUM_RUNNING_VERSIONS - Minimum number of versions to keep deployed (default:
7, max:10) - TERMINATE_RETRY_COUNT - Times to retry terminating oldest build if it fails (default:
3) - TERMINATE_RETRY_DELAY - Seconds between termination retries (default:
10) - DEPLOY - Whether to deploy the bundle (default:
true) - PROMOTE - Whether to promote the deployed version (default:
true)
- Go to Settings → CI/CD → Variables in your GitLab project
- Add the following masked variables:
ARC_XP_ORG_ID- Your Arc XP organization IDARC_XP_API_KEY- Your Arc XP API key (mark as masked)ARC_XP_API_HOSTNAME- Your Arc XP API hostname
stages:
- build
- deploy
build:
stage: build
image: node:20
script:
- npm ci
- npm run build
artifacts:
paths:
- dist/fusion-bundle.zip
include:
- remote: 'https://github.com/code-store-platform/deploy-action/raw/main/gitlab-templates.yml'
deploy_to_arcxp:
extends: .deploy_to_arcxp
stage: deploy
needs: ["build"]
variables:
ARC_XP_ORG_ID: $ARC_XP_ORG_ID
ARC_XP_API_KEY: $ARC_XP_API_KEY
ARC_XP_API_HOSTNAME: $ARC_XP_API_HOSTNAME
BUNDLE_PREFIX: "my-bundle"
PAGEBUILDER_VERSION: "latest"- The job will only run on the
mainbranch by default - Built-in retry logic handles temporary failures
- Ensure your artifact path matches what you specify in the
ARTIFACTvariable