Deploy App Specs to DigitalOcean App Platform
appfile is a declarative spec for deploying apps to the DigitalOcean App Platform. It lets you:
- Keep a directory of app spec values files and maintain changes in version control
- Apply CI/CD to configuration changes
- Visualize a diff of the changes to be applied
- See the status of your app
appfile can be installed in several ways.
You can install directly using the renehernandez/taps as follows:
$ brew install renehernandez/taps/appfileYou can always download the released binaries directly from the Github Releases page. For the latest releases check here
You can leverage appfile with your Github Actions workflows, by using action-appfile:
- Marketplace: https://github.com/marketplace/actions/github-action-for-appfile-cli
- Repository URL: https://github.com/renehernandez/action-appfile
Let's look at an example and see how appfile can help you to manage your App specification and deployments.
This example deploys an App containing a service definition. The 2 environments: review and production will customize the final specification of the app to be deployed. Let's look at the appfile.yaml, app.yaml and environments definitions below.
# appfile.yaml
environments:
review:
- ./envs/review.yaml
production:
- ./envs/production.yaml
specs:
- ./app.yaml# app.yaml
name: {{ .Values.name }}
services:
- name: web
github:
repo: <repo-url>
branch: main
deploy_on_push: {{ .Values.deploy_on_push }}
envs:
- key: WEBSITE_NAME
value: {{ requiredEnv "WEBSITE_NAME" }}# review.yaml
name: sample-review
deploy_on_push: true# production.yaml
name: sample-production
deploy_on_push: falseYou can deploy your App in review by running:
WEBSITE_NAME='Appfile Review' appfile sync --file /path/to/appfile.yaml --environment reviewThe final App spec to be synced to DigitalOcean would be:
name: sample-review
services:
- name: web
github:
repo: <repo-url>
branch: main
deploy_on_push: true
routes:
- path: /
envs:
- key: WEBSITE_NAME
value: Appfile ReviewOr you can deploy your App in production:
WEBSITE_NAME='Appfile Prod' appfile sync --file /path/to/appfile.yaml --environment productionThe final App spec to be synced to DigitalOcean would be:
name: sample-production
services:
- name: web
github:
repo: <repo-url>
branch: main
deploy_on_push: false
routes:
- path: /
envs:
- key: WEBSITE_NAME
value: Appfile ProdTo learn more about appfile, check out the docs
Check out the Contributing page.
For inspecting the changes and tag releases, check the Changelog page
This project is inspired in helmfile, from which I have borrowed heavily for the first iteration.
Check out the LICENSE for details.