This action helps you deploy Apps to Aptible.
There are two deployment strategies, both are supported in this action:
If you are just getting started at Aptible, the easiest deployment strategy is Git Push.
Read the docs on this strategy.
The following inputs can be used as step.with
keys
type
- set togit
username
- Aptible email loginpassword
- Aptible password loginapp
- Aptible App handleenvironment
- Aptible Environment handle the App is hosted within
config_variables
- configuration variables to set
Important
We do not recommend setting config_variables
inside our github action
because those variables only need to be set once within Aptible for them to
persist across deployments.
Learn more.
Assumes you have set secrets (recommended).
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy to Aptible
uses: aptible/aptible-deploy-action@v4
with:
type: git
app: <app name>
environment: <environment name>
username: ${{ secrets.APTIBLE_USERNAME }}
password: ${{ secrets.APTIBLE_PASSWORD }}
Read the docs on this strategy.
To use this image, you should use another workflow step to publish your image to a Docker image registry (for example Docker's).
If you are using a private registry, you can optionally setup Private Registry Authentication once ahead of time using the Aptible CLI. Otherwise, you can pass the credentials directly via the action.
The following inputs can be used as step.with
keys
type
- set todocker
username
- Aptible email loginpassword
- Aptible password loginenvironment
- Aptible Environment handle the App is hosted withinapp
- Aptible App handledocker_img
- the name of the image you'd like to deploy, including its repository and tag
private_registry_username
- the username for the private image registryprivate_registry_password
- the password for the private image registryconfig_variables
- JSON string containing the configuration variables to setdocker_repository_url
- Provide docker repository URL which we can display in our web UI
Important
We do not recommend setting config_variables
inside our github action
because those variables only need to be set once within Aptible for them to
persist across deployments.
Learn more.
status
- success/failure of the deploy
Assumes you have set secrets (recommended).
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy to Aptible
uses: aptible/aptible-deploy-action@v4
with:
type: docker
app: <app name>
environment: <environment name>
username: ${{ secrets.APTIBLE_USERNAME }}
password: ${{ secrets.APTIBLE_PASSWORD }}
docker_img: <docker image name>
private_registry_username: ${{ secrets.DOCKERHUB_USERNAME }}
private_registry_password: ${{ secrets.DOCKERHUB_TOKEN }}
config_variables: DEBUG=app:* FORCE_SSL=true
env:
IMAGE_NAME: user/app:latest
APTIBLE_ENVIRONMENT: "my_environment"
APTIBLE_APP: "my_app"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Allow multi platform builds.
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# Allow use of secrets and other advanced docker features.
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Log into Docker Hub
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Build image using default dockerfile.
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ env.IMAGE_NAME }}
- name: Deploy to Aptible
uses: aptible/aptible-deploy-action@v4
with:
type: docker
app: ${{ env.APTIBLE_APP }}
environment: ${{ env.APTIBLE_ENVIRONMENT }}
username: ${{ secrets.APTIBLE_USERNAME }}
password: ${{ secrets.APTIBLE_PASSWORD }}
docker_img: ${{ env.IMAGE_NAME }}
private_registry_username: ${{ secrets.DOCKERHUB_USERNAME }}
private_registry_password: ${{ secrets.DOCKERHUB_TOKEN }}
config_variables: RELEASE_SHA=${{ github.sha }}