feat: Add environment configuration template for Azure Architect Backend #9
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/CD - Build and Push | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| env: | |
| FRONTEND_IMAGE: ${{ github.repository }}-frontend | |
| BACKEND_IMAGE: ${{ github.repository }}-backend | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v2 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Log in to registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ${{ secrets.REGISTRY_HOST }} | |
| username: ${{ secrets.REGISTRY_USERNAME }} | |
| password: ${{ secrets.REGISTRY_PASSWORD }} | |
| - name: Build and push backend image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: . | |
| file: Dockerfile.backend | |
| push: true | |
| tags: | | |
| ${{ secrets.REGISTRY_HOST }}/${{ env.BACKEND_IMAGE }}:latest | |
| - name: Build and push frontend image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: . | |
| file: Dockerfile.frontend | |
| push: true | |
| tags: | | |
| ${{ secrets.REGISTRY_HOST }}/${{ env.FRONTEND_IMAGE }}:latest | |
| - name: Image summary | |
| run: | | |
| echo "Frontend image: ${{ secrets.REGISTRY_HOST }}/${{ env.FRONTEND_IMAGE }}:latest" | |
| echo "Backend image: ${{ secrets.REGISTRY_HOST }}/${{ env.BACKEND_IMAGE }}:latest" |