docs: refine architecture and implementation guides #12
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: CI - Build, Test, Deploy to Kind | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build-test-deploy: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| #################################################################### | |
| # Build Test Image | |
| #################################################################### | |
| - name: Build Test Image | |
| run: | | |
| docker build \ | |
| --target test \ | |
| -t beyondsquare-test:${{ github.sha }} \ | |
| ./app | |
| #################################################################### | |
| # Run Unit Tests | |
| #################################################################### | |
| - name: Run Unit Tests | |
| run: | | |
| docker run --rm beyondsquare-test:${{ github.sha }} | |
| #################################################################### | |
| # Build Production Image | |
| #################################################################### | |
| - name: Build Production Image | |
| run: | | |
| docker build \ | |
| --target production \ | |
| -t beyondsquare-api:${{ github.sha }} \ | |
| ./app | |
| #################################################################### | |
| # Load Image into Kind | |
| #################################################################### | |
| - name: Load Image into Kind | |
| run: | | |
| kind load docker-image beyondsquare-api:${{ github.sha }} \ | |
| --name beyondsquare | |
| #################################################################### | |
| # Deploy | |
| #################################################################### | |
| - name: Deploy to Kind | |
| run: | | |
| kubectl config use-context kind-beyondsquare | |
| kubectl set image deployment/beyondsquare-api \ | |
| api=beyondsquare-api:${{ github.sha }} | |
| kubectl rollout status deployment/beyondsquare-api --timeout=90s | |
| #################################################################### | |
| # Smoke Test | |
| #################################################################### | |
| - name: Smoke Test | |
| run: | | |
| kubectl run smoke-test \ | |
| --rm \ | |
| -i \ | |
| --restart=Never \ | |
| --image=curlimages/curl \ | |
| -- \ | |
| curl -sf http://beyondsquare-api.default.svc.cluster.local/health |