Skip to content

Merge pull request #97 from DocShow-AI/dev #8

Merge pull request #97 from DocShow-AI/dev

Merge pull request #97 from DocShow-AI/dev #8

name: Build and Deploy
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build and Push Frontend Docker Image
run: |
docker build -t registry.digitalocean.com/docshow-ai/frontend-prod:latest -f frontend/Dockerfile.prod frontend/
echo ${{ secrets.REGISTRY_PASSWORD }} | docker login registry.digitalocean.com -u ${{ secrets.REGISTRY_USERNAME }} --password-stdin
docker push registry.digitalocean.com/docshow-ai/frontend-prod:latest
- name: Build and Push Backend Docker Image
run: |
docker build -t registry.digitalocean.com/docshow-ai/backend-prod:latest -f backend/Dockerfile.prod backend/
echo ${{ secrets.REGISTRY_PASSWORD }} | docker login registry.digitalocean.com -u ${{ secrets.REGISTRY_USERNAME }} --password-stdin
docker push registry.digitalocean.com/docshow-ai/backend-prod:latest
- name: Set up Kubectl and Update Deployment
run: |
echo "${{ secrets.KUBECONFIG_SECRET }}" | base64 --decode > kubeconfig.yml
kubectl --kubeconfig=kubeconfig.yml set image deployment/frontend-deployment frontend=registry.digitalocean.com/docshow-ai/frontend-prod:latest
kubectl --kubeconfig=kubeconfig.yml set image deployment/backend-deployment backend=registry.digitalocean.com/docshow-ai/backend-prod:latest