The following examples ought to help you set up CI/CD workflows on Wodby 2.0 using Wodby CI and third-party CI providers.
For Wodby 1.0 please see 1.0 branch.
See full documentation on Wodby CI at https://wodby.com/docs/2.0/cicd/wodby-ci.
The following examples are for a simple PHP stack:
- Installs your composer dependencies from
composer.json - Builds docker images for php and nginx services with contents of the current directory
./(optionally you can specify docroot directory for nginx image to omitvendordirectory) - Caches contents of
~/.composerdirectory and restores during the next build based oncomposer.lockchecksum - Pushes images to associated docker registry (Wodby registry by default)
- Triggers deployment of the new build to your app instance
Available providers:
- Wodby CI (default):
put these files inside the
.wodbydirectory of your git repository:.wodby/pipeline.yml,.wodby/post-deployment.yml(optional) - GitHub Actions:
put
.github/workflows/wodby.ymlin the root of your git repository and configureWODBY_API_KEYandWODBY_APP_SERVICE_IDrepository secrets. - GitLab CI:
uses the docker-in-docker method.
Put
.gitlab-ci.ymlin the root of your git repository. - CircleCI:
put
.circleci/config.ymlin the root of your git repository.
The following examples are for a simple Node stack:
- Installs your node dependencies from
package.json - Builds docker images for node service with contents of the current directory
./ - Caches contents of
~/.npmdirectory and restores during the next build based onpackage-lock.jsonchecksum - Pushes images to associated docker registry (Wodby registry by default)
- Triggers deployment of the new build to your app instance
Available providers:
- Wodby CI (default):
put these files inside the
.wodbydirectory of your git repository:.wodby/pipeline.yml,.wodby/post-deployment.yml(optional) - GitHub Actions:
put
.github/workflows/wodby.ymlin the root of your git repository and configureWODBY_API_KEYandWODBY_APP_SERVICE_IDrepository secrets. - GitLab CI:
uses the docker-in-docker method.
Put
.gitlab-ci.ymlin the root of your git repository. - CircleCI:
put
.circleci/config.ymlin the root of your git repository.
You can also find boilerplate for build templates for the following stacks:
You can use Wodby 2.0 with third-party CI services like GitHub Actions, GitLab CI, CircleCI, etc. by using Wodby CLI.
The GitHub Actions examples in this repository use wodby/actions/setup-wodby-cli on GitHub-hosted Ubuntu runners.
You can also use any custom CI provider in a similar way with Wodby CLI.
GitLab CI examples in this repository use the docker-in-docker method.
For providers that support it, we recommend using a VM-based environment over a docker-based environment to avoid issues related to docker-in-docker in the build process, since we are building docker images. The CircleCI examples in this repository use the machine executor for that reason.
You can use custom Dockerfile to build your services. Just specify the path to your Dockerfile -f Dockerfile in the pipeline configuration.