-
Notifications
You must be signed in to change notification settings - Fork 116
64 lines (61 loc) · 2.31 KB
/
deploy.yaml
File metadata and controls
64 lines (61 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Pack and Deploy
on:
push:
branches:
- main
- staging
workflow_call:
inputs:
environment:
description: 'Environment (Production, Staging or Staging API)'
required: true
type: string
workflow_dispatch:
inputs:
environment:
description: 'Environment (Production, Staging or Staging API)'
required: true
type: choice
options:
- Production
- Staging
- Staging API
jobs:
setup:
runs-on: ubuntu-latest
permissions:
contents: read
environment: ${{ github.event.inputs.environment != '' && github.event.inputs.environment || (github.ref == 'refs/heads/main' && 'Production' || 'Staging') }}
outputs:
charm_name: ${{ steps.setup-vars.outputs.charm_name }}
channel: ${{ steps.setup-vars.outputs.channel }}
juju_controller_name: ${{ steps.setup-vars.outputs.juju_controller_name }}
juju_model_name: ${{ steps.setup-vars.outputs.juju_model_name }}
environment: ${{ steps.setup-vars.outputs.environment }}
steps:
- name: setup vars
id: setup-vars
run: |
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
echo "environment=${{ github.event.inputs.environment != '' && github.event.inputs.environment || (github.ref == 'refs/heads/main' && 'Production' || 'Staging') }}" >> $GITHUB_OUTPUT
deploy:
needs: setup
name: Deploy
uses: canonical/webteam-devops/.github/workflows/deploy.yaml@main
permissions:
contents: read
deployments: write
packages: write
with:
environment: ${{ needs.setup.outputs.environment }}
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 }}