CI/CD
Continuous Integration and Continuous Delivery (CI/CD) is a software development practice that enables developers to automate the process of building, testing, and deploying applications. This practice helps to deliver code changes more frequently and reliably, ensuring that the application is always in a deployable state.
To learn more about CI/CD for App builder, refer to CI/CD for App Builder Applications.
To assist with CI/CD implementation, review the following workflow examples.
Workflow Examples
The following workflow examples implement the continuous integration using Github Actions.
Production deployment example
The deploy_prod.yml workflow triggers on a release event (Github Events that trigger Workflows), which is when a release is marked as released. It also defines a single job called deploy
, which performs the following steps sequentially to deploy the application to production.
Environment Setup - Performs the following setup steps:
- Matrix Strategy: The job runs on Ubuntu (ubuntu-latest) using Node.js version 20. It only allows one parallel execution (
max-parallel: 1
) and executes the following steps:- Checkout Code: Retrieves the code from the repository using
actions/checkout
. - Setup Node.js: Configures the specified Node.js version (20).
- Checkout Code: Retrieves the code from the repository using
- Matrix Strategy: The job runs on Ubuntu (ubuntu-latest) using Node.js version 20. It only allows one parallel execution (
NPM Install - Installs the required dependencies for the application, like Node Package manager.
CLI Setup - Installs and configures the
Adobe I/O CLI
tool using theadobe/aio-cli-setup-action
action.Authentication - Authenticates with
Adobe I/O
using secure credentials stored as secrets (for example,CLIENTID_PROD
andCLIENTSECRET_PROD
). Refer to Secrets in Github Actions to configure variables as secrets.Build Process - Builds the application using the build command from
adobe/aio-apps-action
.Deployment - Deploys the application to production using the
deploy
command. Relevant credentials, likeAIO_RUNTIME_NAMESPACE
andAIO_RUNTIME_AUTH
and project details likeAIO_PROJECT_NAME
andAIO_PROJECT_WORKSPACE_NAME
, are securely provided as environment variables. You must define these variables in the repository settings.
Stage deployment example
The deploy_stage.yml workflow is the same as the Production deployment example, with the following key differences:
The workflow triggers on a push to the
main
branch.Authentication and deployment secrets are staging-specific which means you must define them separately for this environment.
Pull request testing example
The pr_test.yml workflow triggers when you open, update, or synchronize a pull request, which creates a Pull request event. This workflow allows you to test changes in the pull request across multiple operating systems and Node.js versions before merging it into the main branch.
The testing workflow performs the following steps:
Environment Setup - Checks out the code using the
checkout
action and configures Node.js using thesetup-node
action.Dependency Installation - Installs necessary dependencies with
npm i
.CLI Setup - Installs and configures the
Adobe I/O CLI
tool.Authentication - Authenticates using staging credentials stored in GitHub secrets, ensuring secure access to
Adobe I/O
services.Build Process - Builds the application to ensure all components compile successfully.
Testing - Runs the
test
command viaadobe/aio-apps-action
to validate functionality.