This repository contains a collection of scripts/GitHub Actions workflows for deploying and managing deployments of webteam applications.
This GitHub Action workflow is designed to automate the packing, publishing and deployment of a charm and its associated OCI image (rock) for a flask 12-factor application.
This action assumes the following:
- a
rockcraft.yamlfile exists in the root of the repository - the charm source code and
charmcraft.yamlare in thecharm/directory. - the charm is published on charmhub.io
π₯ Inputs
These inputs must be provided by the workflow that calls this one:
| Input | Type | Required | Description |
|---|---|---|---|
charm_name |
string |
β | Name of the charm to package and release. |
channel |
string |
β | Channel to release the charm to (e.g., edge, beta). |
juju_controller_name |
string |
β | Name of the Juju controller to deploy to (on PS6). |
juju_model_name |
string |
β | Name of the Juju model to deploy to (on PS6). |
environment |
string |
β | If using Github Deployment Environments pass the environment here to use it (to get secrets for example) |
The following secrets must be defined in the calling workflow or repository (either at the repository level, in a deployment environment, or in the workflow itself). These secrets are used to authenticate with Vault and Charmhub, and to pass necessary credentials to juju for deployment:
| Secret | Required | Description |
|---|---|---|
VAULT_APPROLE_ROLE_ID |
β | Get this from your PS6 model echo $VAULT_APPROLE_ROLE_ID |
VAULT_APPROLE_SECRET_ID |
β | Get this from your PS6 model echo $VAULT_APPROLE_SECRET_ID |
CHARMHUB_TOKEN |
β | Auth token used by Charmcraft to interact with Charmhub. Use charmcraft login docs to get the token |
deploy:
needs: setup
name: Deploy
uses: canonical/webteam-devops/.github/workflows/deploy.yaml@main
with:
charm_name: snapcraft
channel: edge
juju_controller_name: juju-controller-36-production-ps6
juju_model_name: prod-snapcraft
secrets:
VAULT_APPROLE_ROLE_ID: ${{ secrets.VAULT_APPROLE_ROLE_ID }}
VAULT_APPROLE_SECRET_ID: ${{ secrets.VAULT_APPROLE_SECRET_ID }}
CHARMHUB_TOKEN: ${{ secrets.CHARMHUB_TOKEN }}