Merge pull request #429 from natnaelat/Book_Editor_Interface #178
This file contains hidden or 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 Kubernetes | |
| on: | |
| push: | |
| branches: | |
| - main # or any branch you want to deploy from | |
| jobs: | |
| build_and_deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Steps will be defined here | |
| - name: Checkout Code | |
| uses: actions/checkout@v2 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v1 | |
| - name: Echo non secret env | |
| run: | | |
| touch ./frontend/.env | |
| echo '${{ secrets.FRONTEND_ENV }}' >> ./frontend/.env | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v1 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.CR_PAT }} | |
| - name: Build and Push | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: frontend | |
| file: frontend/Dockerfile | |
| push: true | |
| tags: ghcr.io/${{ github.repository_owner }}/codekids:${{ github.sha }} | |
| - name: Set up Kubectl | |
| uses: azure/setup-kubectl@v1 | |
| with: | |
| version: "latest" | |
| - name: Update Kubernetes Deployment | |
| run: | | |
| echo "${{ secrets.KUBE_CONFIG }}" | base64 -d > ./kubeconfig | |
| export KUBECONFIG=./kubeconfig | |
| kubectl set image deployment/codekids codekids=ghcr.io/${{ github.repository_owner }}/codekids:${{ github.sha }} --namespace codekids-app |