This repository has been archived by the owner on Oct 16, 2024. It is now read-only.
⬆️ Bump setuptools to 70.0.0 #118
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 Development Namespace" | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
env: | |
KUBE_CLUSTER: ${{ secrets.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.DEV_ECR_REGISTRY }} | |
ECR_REPOSITORY: ${{ vars.DEV_ECR_REPOSITORY }} | |
ADMIN_GITHUB_TOKEN: ${{ secrets.DEV_ADMIN_GITHUB_TOKEN }} | |
FLASK_APP_SECRET: ${{ secrets.DEV_FLASK_APP_SECRET }} | |
AUTH0_CLIENT_ID: ${{ secrets.DEV_AUTH0_CLIENT_ID }} | |
AUTH0_CLIENT_SECRET: ${{ secrets.DEV_AUTH0_CLIENT_SECRET }} | |
SENTRY_DSN_KEY: ${{ secrets.SENTRY_DSN_KEY }} | |
jobs: | |
build-push: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.DEV_ECR_ROLE_TO_ASSUME }} | |
aws-region: ${{ vars.DEV_ECR_REGION }} | |
- uses: aws-actions/amazon-ecr-login@v2 | |
id: login-ecr | |
- 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 | |
- 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: Deploy helm chart to dev | |
run: | | |
helm upgrade join-github \ | |
helm/join-github \ | |
--install \ | |
--force \ | |
--wait \ | |
--timeout 10m \ | |
--namespace ${KUBE_NAMESPACE} \ | |
--values=helm/join-github/values-dev.yaml \ | |
--set app.deployment.env.AUTH0_CLIENT_ID=${AUTH0_CLIENT_ID} \ | |
--set app.deployment.env.AUTH0_CLIENT_SECRET=${AUTH0_CLIENT_SECRET} \ | |
--set app.deployment.env.APP_SECRET_KEY=${FLASK_APP_SECRET} \ | |
--set app.deployment.env.ADMIN_GITHUB_TOKEN=${ADMIN_GITHUB_TOKEN} \ | |
--set app.deployment.env.SENTRY_DSN_KEY=${SENTRY_DSN_KEY} \ | |
--set app.deployment.image.repository=${ECR_REGISTRY}/${ECR_REPOSITORY} \ | |
--set app.deployment.image.tag=${IMAGE_TAG} |