|
9 | 9 |
|
10 | 10 | jobs: |
11 | 11 | build: |
| 12 | + name: 🧪 Build |
12 | 13 | runs-on: ubuntu-latest |
13 | | - |
| 14 | + |
14 | 15 | steps: |
15 | | - - name: Checkout code |
16 | | - uses: actions/checkout@v4 |
17 | | - |
18 | | - - name: Setup .NET |
19 | | - uses: actions/setup-dotnet@v4 |
20 | | - with: |
21 | | - dotnet-version: '10.0.x' |
22 | | - |
23 | | - - name: Restore dependencies |
24 | | - run: dotnet restore ShipServicesApp.sln |
25 | | - |
26 | | - - name: Build solution |
27 | | - run: dotnet build ShipServicesApp.sln --configuration Release --no-restore |
28 | | - |
29 | | - - name: Run tests |
30 | | - run: dotnet test ShipServicesApp.sln --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" |
31 | | - |
32 | | - - name: Publish application |
33 | | - run: dotnet publish ShipServicesApp.sln --configuration Release --no-build --output ./publish |
34 | | - |
35 | | - - name: Upload build artifacts |
36 | | - uses: actions/upload-artifact@v4 |
37 | | - with: |
38 | | - name: ship-services-app |
39 | | - path: ./publish |
40 | | - retention-days: 30 |
41 | | - |
42 | | - deployToDev: |
| 16 | + - name: Checkout code |
| 17 | + uses: actions/checkout@v4 |
| 18 | + |
| 19 | + - name: Setup .NET |
| 20 | + uses: actions/setup-dotnet@v4 |
| 21 | + with: |
| 22 | + dotnet-version: '10.0.x' |
| 23 | + |
| 24 | + - name: Restore dependencies |
| 25 | + run: dotnet restore ShipServicesApp.sln |
| 26 | + |
| 27 | + - name: Build solution |
| 28 | + run: dotnet build ShipServicesApp.sln --configuration Release --no-restore |
| 29 | + |
| 30 | + - name: Run tests |
| 31 | + run: dotnet test ShipServicesApp.sln --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" |
| 32 | + |
| 33 | + - name: Publish application |
| 34 | + run: dotnet publish ShipServicesApp.sln --configuration Release --no-build --output ./publish |
| 35 | + |
| 36 | + - name: Upload build artifacts |
| 37 | + uses: actions/upload-artifact@v4 |
| 38 | + with: |
| 39 | + name: ship-services-app |
| 40 | + path: ./publish |
| 41 | + retention-days: 30 |
| 42 | + |
| 43 | + deployToDev: |
43 | 44 | name: 🚀 Deploy to Dev |
44 | 45 | runs-on: ubuntu-latest |
45 | 46 | # if: github.ref == 'refs/heads/develop' |
|
58 | 59 | run: | |
59 | 60 | echo "deployment to Dev" |
60 | 61 | ls -la |
| 62 | +
|
| 63 | + deployToProd: |
| 64 | + name: 🚀 Deploy to Production |
| 65 | + runs-on: ubuntu-latest |
| 66 | + # if: github.ref == 'refs/heads/main' |
| 67 | + environment: |
| 68 | + name: deploytoprod |
| 69 | + needs: [build, deployToDev] |
| 70 | + |
| 71 | + steps: |
| 72 | + - name: Download artifact from build job |
| 73 | + uses: actions/download-artifact@v4 |
| 74 | + with: |
| 75 | + name: ship-services-app |
| 76 | + path: . |
| 77 | + |
| 78 | + - name: deploy step |
| 79 | + run: | |
| 80 | + echo "deployment to Prod" |
| 81 | + ls -la |
0 commit comments