⬆️ Bump Authlib and requests packages following cve #128
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Dev | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- "main" | |
env: | |
KUBE_CLUSTER: ${{ secrets.DEV_KUBE_CLUSTER }} | |
KUBE_NAMESPACE: ${{ secrets.DEV_KUBE_NAMESPACE }} | |
KUBE_CERT: ${{ secrets.DEV_KUBE_CERT }} | |
KUBE_TOKEN: ${{ secrets.DEV_KUBE_TOKEN }} | |
IMAGE_TAG: ${{ github.sha }} | |
ECR_REGISTRY: ${{ vars.ECR_REGISTRY }} | |
ECR_REPOSITORY: ${{ vars.DEVELOPMENT_ECR_REPOSITORY }} | |
AUTH0_CLIENT_ID: ${{ secrets.AUTH0_CLIENT_ID }} | |
AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_CLIENT_SECRET }} | |
FLASK_APP_SECRET: ${{ secrets.DEV_FLASK_APP_SECRET }} | |
OPS_ENG_REPORTS_ENCRYPT_KEY: ${{ secrets.DEV_OPS_ENG_REPORTS_ENCRYPT_KEY }} | |
OPERATIONS_ENGINEERING_REPORTS_API_KEY: ${{ secrets.DEV_OPERATIONS_ENGINEERING_REPORTS_API_KEY }} | |
jobs: | |
build-push: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
- uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.DEVELOPMENT_ECR_ROLE_TO_ASSUME }} | |
aws-region: eu-west-2 | |
- uses: aws-actions/amazon-ecr-login@v2 | |
- run: | | |
docker build -t ${ECR_REGISTRY}/${ECR_REPOSITORY}:${IMAGE_TAG} . | |
docker push ${ECR_REGISTRY}/${ECR_REPOSITORY}:${IMAGE_TAG} | |
deploy-to-dev: | |
needs: build-push | |
runs-on: ubuntu-latest | |
container: alpine/k8s:1.23.17 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- name: Authenticate to the cluster | |
run: | | |
echo "${KUBE_CERT}" > ca.crt | |
kubectl config set-cluster ${KUBE_CLUSTER} --certificate-authority=./ca.crt --server=https://${KUBE_CLUSTER} | |
kubectl config set-credentials deploy-user --token=${KUBE_TOKEN} | |
kubectl config set-context ${KUBE_CLUSTER} --cluster=${KUBE_CLUSTER} --user=deploy-user --namespace=${KUBE_NAMESPACE} | |
kubectl config get-contexts | |
kubectl config use-context ${KUBE_CLUSTER} | |
- name: Helm install | |
run: | | |
helm upgrade operations-engineering-reports-dev \ | |
helm/operations-engineering-reports \ | |
--install \ | |
--force \ | |
--wait \ | |
--timeout 10m \ | |
--namespace ${KUBE_NAMESPACE} \ | |
--set image.tag=${IMAGE_TAG} \ | |
--set application.auth0ClientId=${AUTH0_CLIENT_ID} \ | |
--set application.auth0ClientSecret=${AUTH0_CLIENT_SECRET} \ | |
--set application.appSecretKey=${FLASK_APP_SECRET} \ | |
--set application.encryptionKey=${OPS_ENG_REPORTS_ENCRYPT_KEY} \ | |
--set application.apiKey=${OPERATIONS_ENGINEERING_REPORTS_API_KEY} \ | |
--set image.repository=${ECR_REGISTRY}/${ECR_REPOSITORY} \ | |
--set ingress.hosts={operations-engineering-reports-dev.cloud-platform.service.justice.gov.uk} |