Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First draft of CD workflow #108

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
qa:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
Expand All @@ -19,7 +19,7 @@ jobs:
needs: qa
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Deploy

on:
push:
branches:
- feature/actions_deploy
# workflow_run:
# workflows: [Build and Publish] # Only run this once Build and Publish has succeeded (image is available)
# types: [completed]
# branches: [develop, feature/actions_deploy] # Only deploy develop branch to our CI dev instance

permissions:
id-token: write
contents: read
actions: read

jobs:
deploy:
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
environment: develop
steps:
- name: checkout the Helm charts to deploy our published instance
uses: actions/checkout@v4
with:
repository: ImperialCollegeLondon/helm-invenio
path: helm-invenio
ref: imperial_deployment

- name: Login to Azure to deploy our chart
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Gets K8s context
uses: azure/aks-set-context@v4
with:
resource-group: ${{ vars.RESOURCE_GROUP }}
cluster-name: ${{ vars.CLUSTER_NAME }}
id: login

- name: Configure deployment
uses: azure/k8s-bake@v3
with:
renderEngine: "helm"
helmChart: ${{ vars.CHART_PATH }}
overrideFiles: ${{ vars.CHART_OVERRIDE_PATH }}
helm-version: "latest"
releaseName: "develop"
namespace: invenio
overrides: |
invenio.secret_key: ${{ secrets.INVENIO_SECRET_KEY }}
invenio.security_login_salt: ${{ secrets.INVENIO_SECURITY_LOGIN_SALT }}
invenio.csrf_secret_salt: ${{ secrets.INVENIO_CSRF_SECRET_SALT }}
invenio.extraConfig.ICL_OAUTH_CLIENT_ID: ${{ vars.ICL_OAUTH_CLIENT_ID }}
invenio.extraConfig.ICL_OAUTH_CLIENT_SECRET: ${{ secrets.ICL_OAUTH_CLIENT_SECRET }}
invenio.extraConfig.ICL_OAUTH_WELL_KNOWN_URL: ${{ vars.ICL_OAUTH_WELL_KNOWN_URL }}
rabbitmq.auth.password: ${{ secrets.RABBITMQ_AUTH_PASSWORD }}
postgresql.auth.password: ${{ secrets.POSTGRESQL_AUTH_PASSWORD }}
invenio.web.image: ${{ vars.IMAGE_NAME }}
id: bake
- name: Deploys application
uses: Azure/k8s-deploy@v5
with:
manifests: ${{ steps.bake.outputs.manifestsBundle }}
namespace: invenio
Loading