Skip to content

Commit

Permalink
final action
Browse files Browse the repository at this point in the history
  • Loading branch information
davidleonm committed Nov 20, 2024
1 parent 299f731 commit 1b6e344
Showing 1 changed file with 153 additions and 14 deletions.
167 changes: 153 additions & 14 deletions .github/workflows/on-push-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
push:
branches:
- '*' # TODO - master
env:
PLATFORMS: linux/arm64

jobs:
deploy:
Expand All @@ -17,28 +19,60 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
# - name: Install dependencies
# run: npm install --prefix ./Code/src/WeatherStationProject.Dashboard.App/ClientApp install --force && dotnet restore ./Code/WeatherStationProjectDashboard.sln
# - name: Build
# run: dotnet build ./Code/WeatherStationProjectDashboard.sln
# - name: Test with the dotnet CLI
# run: dotnet test
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get version
- name: Get dashboard version
id: dashboard_version
uses: KageKirin/get-csproj-version@v1
with:
file: ./Code/src/WeatherStationProject.Dashboard.App/WeatherStationProject.Dashboard.App.csproj
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
# with:
# platforms: linux/arm64

- name: Get air parameters version
id: air_parameters_version
uses: KageKirin/get-csproj-version@v1
with:
file: ./Code/src/WeatherStationProject.Dashboard.AirParametersService/WeatherStationProject.Dashboard.AirParametersService.csproj

- name: Get ambient temperatures version
id: ambient_temperatures_version
uses: KageKirin/get-csproj-version@v1
with:
file: ./Code/src/WeatherStationProject.Dashboard.AmbientTemperatureService/WeatherStationProject.Dashboard.AmbientTemperatureService.csproj

- name: Get authentication version
id: authentication_version
uses: KageKirin/get-csproj-version@v1
with:
file: ./Code/src/WeatherStationProject.Dashboard.AuthenticationService/WeatherStationProject.Dashboard.AuthenticationService.csproj

- name: Get gateway version
id: gateway_version
uses: KageKirin/get-csproj-version@v1
with:
file: ./Code/src/WeatherStationProject.Dashboard.GatewayService/WeatherStationProject.Dashboard.GatewayService.csproj

- name: Get ground temperature version
id: ground_temperatures_version
uses: KageKirin/get-csproj-version@v1
with:
file: ./Code/src/WeatherStationProject.Dashboard.GroundTemperatureService/WeatherStationProject.Dashboard.GroundTemperatureService.csproj

- name: Get rainfall service version
id: rainfall_version
uses: KageKirin/get-csproj-version@v1
with:
file: ./Code/src/WeatherStationProject.Dashboard.RainfallService/WeatherStationProject.Dashboard.RainfallService.csproj

- name: Get wind measurements version
id: wind_measurements_version
uses: KageKirin/get-csproj-version@v1
with:
file: ./Code/src/WeatherStationProject.Dashboard.WindMeasurementsService/WeatherStationProject.Dashboard.WindMeasurementsService.csproj

- name: Build and push Dashboard
id: push
uses: docker/build-push-action@v6
with:
context: .
Expand All @@ -47,8 +81,113 @@ jobs:
"PROJECT_NAME_ARG=WeatherStationProject.Dashboard.App"
"ENVIRONMENT_ARG=Production"
file: ./Dockerfile
platforms: linux/arm64
platforms: ${{ env.PLATFORMS }}
push: true
tags: |
weatherstationproject/dashboard:${{ steps.dashboard_version.outputs.version }}
weatherstationproject/dashboard:latest
weatherstationproject/dashboard:latest
- name: Build and push air parameters service
uses: docker/build-push-action@v6
with:
context: .
build-args: |
"INCLUDE_NPM_ARG=false"
"PROJECT_NAME_ARG=WeatherStationProject.Dashboard.AirParametersService"
"ENVIRONMENT_ARG=Production"
file: ./Dockerfile
platforms: ${{ env.PLATFORMS }}
push: true
tags: |
weatherstationproject/air-parameter-service:${{ steps.air_parameters_version.outputs.version }}
weatherstationproject/air-parameter-service:latest
- name: Build and push ambient temperatures
uses: docker/build-push-action@v6
with:
context: .
build-args: |
"INCLUDE_NPM_ARG=false"
"PROJECT_NAME_ARG=WeatherStationProject.Dashboard.AmbientTemperatureService"
"ENVIRONMENT_ARG=Production"
file: ./Dockerfile
platforms: ${{ env.PLATFORMS }}
push: true
tags: |
weatherstationproject/ambient-temperature-service:${{ steps.ambient_temperatures_version.outputs.version }}
weatherstationproject/ambient-temperature-service:latest
- name: Build and push authentication service
uses: docker/build-push-action@v6
with:
context: .
build-args: |
"INCLUDE_NPM_ARG=false"
"PROJECT_NAME_ARG=WeatherStationProject.Dashboard.AuthenticationService"
"ENVIRONMENT_ARG=Production"
file: ./Dockerfile
platforms: ${{ env.PLATFORMS }}
push: true
tags: |
weatherstationproject/authentication-service:${{ steps.authentication_version.outputs.version }}
weatherstationproject/authentication-service:latest
- name: Build and push gateway service
uses: docker/build-push-action@v6
with:
context: .
build-args: |
"INCLUDE_NPM_ARG=false"
"PROJECT_NAME_ARG=WeatherStationProject.Dashboard.GatewayService"
"ENVIRONMENT_ARG=Production"
file: ./Dockerfile
platforms: ${{ env.PLATFORMS }}
push: true
tags: |
weatherstationproject/gateway-service:${{ steps.gateway_version.outputs.version }}
weatherstationproject/gateway-service:latest
- name: Build and push ground temperature service
uses: docker/build-push-action@v6
with:
context: .
build-args: |
"INCLUDE_NPM_ARG=false"
"PROJECT_NAME_ARG=WeatherStationProject.Dashboard.GroundTemperatureService"
"ENVIRONMENT_ARG=Production"
file: ./Dockerfile
platforms: ${{ env.PLATFORMS }}
push: true
tags: |
weatherstationproject/ground-temperature-service:${{ steps.ground_temperatures_version.outputs.version }}
weatherstationproject/ground-temperature-serviced:latest
- name: Build and push rainfall service
uses: docker/build-push-action@v6
with:
context: .
build-args: |
"INCLUDE_NPM_ARG=false"
"PROJECT_NAME_ARG=WeatherStationProject.Dashboard.RainfallService"
"ENVIRONMENT_ARG=Production"
file: ./Dockerfile
platforms: ${{ env.PLATFORMS }}
push: true
tags: |
weatherstationproject/rainfall-service:${{ steps.rainfall_version.outputs.version }}
weatherstationproject/rainfall-service:latest
- name: Build and push wind measurements service
uses: docker/build-push-action@v6
with:
context: .
build-args: |
"INCLUDE_NPM_ARG=false"
"PROJECT_NAME_ARG=WeatherStationProject.Dashboard.WindMeasurementsService"
"ENVIRONMENT_ARG=Production"
file: ./Dockerfile
platforms: ${{ env.PLATFORMS }}
push: true
tags: |
weatherstationproject/wind-measurements-service:${{ steps.wind_measurements_version.outputs.version }}
weatherstationproject/wind-measurements-service:latest

0 comments on commit 1b6e344

Please sign in to comment.