Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

test: modify charmcraft.yaml to trigger workflow #12

test: modify charmcraft.yaml to trigger workflow

test: modify charmcraft.yaml to trigger workflow #12

Workflow file for this run

name: Pack and Deploy
on:
push:
branches:
- main
- staging
# to be deleted after testing
- charm-jaas
workflow_dispatch:
inputs:
environment:
description: 'Environment (Production or Staging)'
required: true
type: choice
options:
- Production
- Staging
jobs:
find-env:
name: Find environment
runs-on: ubuntu-latest
outputs:
environment: ${{ steps.set_env.outputs.environment }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Determine environment
id: set_env
run: |
if [[ -n "${{ github.event.inputs.environment }}" ]]; then
echo "environment=${{ github.event.inputs.environment }}" >> "$GITHUB_OUTPUT"
elif [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then
echo "environment=Production" >> "$GITHUB_OUTPUT"
else
echo "environment=Staging" >> "$GITHUB_OUTPUT"
fi
setup:
name: Setup
runs-on: ubuntu-latest
needs: find-env
environment: ${{ needs.find-env.outputs.environment }}
outputs:
environment: ${{ steps.set.outputs.environment }}
environmentUrl: ${{ steps.set.outputs.environmentUrl }}
charm_name: ${{ steps.set.outputs.charm_name }}
channel: ${{ steps.set.outputs.channel }}
juju_controller_name: ${{ steps.set.outputs.juju_controller_name }}
juju_model_name: ${{ steps.set.outputs.juju_model_name }}
steps:
- id: set
run: |
echo "environment=${{ needs.find-env.outputs.environment }}" >> "$GITHUB_OUTPUT"
echo "environmentUrl=${{ vars.ENVIRONMENT_URL }}" >> "$GITHUB_OUTPUT"
echo "charm_name=${{ vars.CHARM_NAME }}" >> "$GITHUB_OUTPUT"
echo "channel=${{ vars.CHANNEL }}" >> "$GITHUB_OUTPUT"
echo "juju_controller_name=${{ vars.JUJU_CONTROLLER_NAME }}" >> "$GITHUB_OUTPUT"
echo "juju_model_name=${{ vars.JUJU_MODEL_NAME }}" >> "$GITHUB_OUTPUT"
deploy:
needs: setup
name: Deploy
uses: canonical/webteam-devops/.github/workflows/deploy.yaml@refactor-deploy-github-action
with:
environment: ${{ needs.setup.outputs.environment }}
environmentUrl: ${{ needs.setup.outputs.environmentUrl }}
charm_name: ${{ needs.setup.outputs.charm_name }}
channel: ${{ needs.setup.outputs.channel }}
juju_controller_name: ${{ needs.setup.outputs.juju_controller_name }}
juju_model_name: ${{ needs.setup.outputs.juju_model_name }}
secrets:
VAULT_APPROLE_ROLE_ID: ${{ secrets.VAULT_APPROLE_ROLE_ID }}
VAULT_APPROLE_SECRET_ID: ${{ secrets.VAULT_APPROLE_SECRET_ID }}
CHARMHUB_TOKEN: ${{ secrets.CHARMHUB_TOKEN }}