64 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			64 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| name: Build and Push Microservices
 | |
| 
 | |
| on:
 | |
|   push:
 | |
|     branches:
 | |
|       - master
 | |
|   workflow_dispatch:
 | |
| 
 | |
| jobs:
 | |
|   build-and-push:
 | |
|     runs-on: ubuntu-latest
 | |
|     permissions:
 | |
|       contents: read
 | |
|       packages: write
 | |
| 
 | |
|     strategy:
 | |
|       matrix:
 | |
|         include:
 | |
|           - service: Sphere
 | |
|             image: sphere
 | |
|           - service: Pass
 | |
|             image: pass
 | |
|           - service: Ring
 | |
|             image: ring
 | |
|           - service: Drive
 | |
|             image: drive
 | |
|           - service: Develop
 | |
|             image: develop
 | |
|           - service: Gateway
 | |
|             image: gateway
 | |
|           - service: Insight
 | |
|             image: insight
 | |
| 
 | |
|     steps:
 | |
|       - name: Checkout repository
 | |
|         uses: actions/checkout@v4
 | |
|         with:
 | |
|           fetch-depth: 0
 | |
| 
 | |
|       - name: Setup NBGV
 | |
|         uses: dotnet/nbgv@master
 | |
|         id: nbgv
 | |
| 
 | |
|       - name: Set up Docker Buildx
 | |
|         uses: docker/setup-buildx-action@v3
 | |
| 
 | |
|       - name: Log in to GitHub Container Registry
 | |
|         uses: docker/login-action@v3
 | |
|         with:
 | |
|           registry: ghcr.io
 | |
|           username: ${{ github.actor }}
 | |
|           password: ${{ secrets.GITHUB_TOKEN }}
 | |
| 
 | |
|       - name: Build and push Docker image for ${{ matrix.service }}
 | |
|         uses: docker/build-push-action@v6
 | |
|         with:
 | |
|           context: .
 | |
|           file: DysonNetwork.${{ matrix.service }}/Dockerfile
 | |
|           push: true
 | |
|           tags: |
 | |
|             ghcr.io/${{ vars.PACKAGE_OWNER }}/dyson-${{ matrix.image }}:${{ steps.nbgv.outputs.SimpleVersion }}
 | |
|             ghcr.io/${{ vars.PACKAGE_OWNER }}/dyson-${{ matrix.image }}:latest
 | |
|           platforms: linux/amd64
 |