|
| 1 | +name: Deploy |
| 2 | + |
| 3 | +env: |
| 4 | + AZURE_CONTAINER_REGISTRY: MY_REGISTRY_NAME # set this to the name of your container registry |
| 5 | + PROJECT_NAME: MY_PROJECT_NAME # set this to your project's name |
| 6 | + RESOURCE_GROUP: invenio-dev # the resource group containing your AKS cluster |
| 7 | + CLUSTER_NAME: InvenioRDM-Dev # the name of your AKS cluster |
| 8 | + CHART_PATH: "~/helm-invenio/charts/invenio/Chart.yml" # set this to the path to your helm file |
| 9 | + CHART_OVERRIDE_PATH: "~/helm-invenio/charts/invenio/values-overrides-imperial.yaml" # array of override file paths |
| 10 | + |
| 11 | +on: |
| 12 | + workflow_run: |
| 13 | + workflows: [Build and Publish] # Only run this once Build and Publish has succeeded (image is available) |
| 14 | + types: [completed] |
| 15 | + branches: [develop, feature/actions_deploy] # Only deploy develop branch to our CI dev instance |
| 16 | + |
| 17 | +permissions: |
| 18 | + id-token: write # for Azure OIDC, see https://github.com/Azure/login |
| 19 | + contents: read |
| 20 | + |
| 21 | +jobs: |
| 22 | + deploy: |
| 23 | + if: ${{ github.event.workflow_run.conclusion == 'success' }} |
| 24 | + runs-on: ubuntu-latest |
| 25 | + steps: |
| 26 | + - name: checkout the Helm charts to deploy our published instance |
| 27 | + uses: actions/checkout@v4 |
| 28 | + with: |
| 29 | + repository: ImperialCollegeLondon/helm-invenio # Currently public, need to add a token if set to private |
| 30 | + token: ${{ secrets.TOKEN_TO_PULL_HELM_REPO }} |
| 31 | + fetch-depth: 0 |
| 32 | + |
| 33 | + - name: Login to Azure to deploy our chart |
| 34 | + uses: azure/login@v2 |
| 35 | + with: |
| 36 | + creds: ${{ secrets.AZURE_CREDENTIALS }} |
| 37 | + |
| 38 | + - name: Gets K8s context |
| 39 | + uses: azure/aks-set-context@v4 |
| 40 | + with: |
| 41 | + creds: ${{ secrets.AZURE_CREDENTIALS }} |
| 42 | + resource-group: ${{ env.RESOURCE_GROUP }} |
| 43 | + cluster-name: ${{ env.CLUSTER_NAME }} |
| 44 | + id: login |
| 45 | + |
| 46 | + - name: Configure deployment |
| 47 | + uses: azure/k8s-bake@61041e8c2f75c1f01186c8f05fb8b24e1fc507d8 |
| 48 | + with: |
| 49 | + renderEngine: 'helm' |
| 50 | + helmChart: ${{ env.CHART_PATH }} |
| 51 | + overrideFiles: ${{ env.CHART_OVERRIDE_PATH }} |
| 52 | + helm-version: 'latest' |
| 53 | + id: bake |
0 commit comments