CDN cache purge automation migration from Jenkins to GitHub Actions in AEM as a Cloud Service
This article describes how to move CDN cache purge automation from Jenkins to GitHub Actions in Adobe Experience Manager as a Cloud Service, including generating a new purge API token and configuring it securely in your GitHub Actions workflow.
Description description
Environment
- Adobe Experience Manager as a Cloud Service
- Adobe-managed CDN
- Cloud Manager
- Jenkins
- GitHub Actions
Issue/Symptoms
- CDN cache purges are automated through Jenkins.
- The existing purge key is stored as a masked Jenkins credential and can’t be retrieved or viewed.
- The CDN cache purge automation must be migrated from Jenkins to GitHub Actions.
- GitHub Actions requires a new purge API token for the purge requests.
- The Jenkins and GitHub Actions workflows must continue to function during the phased migration.
Cause
The purge key used by Jenkins is stored as a masked secret credential and can’t be retrieved for reuse. The GitHub Actions workflow therefore requires a new purge API token stored as a GitHub Actions secret.
Resolution resolution
Follow the steps below to migrate the CDN cache purge automation:
-
Review the official documentation for generating a CDN Purge API Token:
Configure a Purge API Token -
Follow the documented self-service process to generate a new Purge API Token.
-
In the GitHub repository, go to Settings
>Secrets and variables>Actions. -
Select New repository secret, and add the new Purge API Token as a secret. For example, name the secret
AEM_PURGE_API_TOKEN. -
Update the GitHub Actions workflow to use the new secret. For example:
code language-none - name: Purge CDN Cache run: | curl -X PURGE "" \ -H "X-AEM-Purge-Key: ${{ secrets.AEM_PURGE_API_TOKEN }}" \ -H "X-AEM-Purge: all" -
Test the GitHub Actions workflow and verify that it successfully purges the CDN cache by using the new API token.
-
During the migration, continue using the legacy purge key in the Jenkins jobs while the key remains valid.