build(deps): bump Constructs from 10.4.1 to 10.4.2 (#1416) #553
This file contains 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: SPMS Build (.NET) | |
on: | |
push: | |
branches: [main, production] | |
tags: | |
- v* | |
pull_request: | |
branches: [main, production] | |
env: | |
IMAGE_NAME: spms | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
services: | |
mongodb: | |
image: mongo | |
ports: | |
- 27017:27017 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
dotnet-quality: 'preview' | |
- name: Install Dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore -c Release | |
- name: Test | |
run: dotnet test --collect:"XPlat Code Coverage" | |
env: | |
ConnectionStrings__mongo: mongodb://localhost:27017 | |
AzureAd__ClientId: dummy | |
AzureAd__ClientSecret: dummy | |
- uses: codecov/codecov-action@v4 | |
name: Report Unit Test | |
with: | |
directory: SimplePasswordManagerService.Test/ | |
flags: unittests | |
- uses: codecov/codecov-action@v4 | |
name: Report Integration Test | |
with: | |
directory: SimplePasswordManagerService.Integration.Test/ | |
flags: integrationtests | |
- name: Publish | |
run: dotnet publish SimplePasswordManagerService -c Release --no-restore --no-build -o published | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: published | |
path: published | |
- name: Publish Image | |
run: dotnet publish SimplePasswordManagerService --os linux --arch x64 /t:PublishContainer -c Release | |
docker-push-api: | |
needs: build | |
runs-on: ubuntu-22.04 | |
if: github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
bervproject/${{ env.IMAGE_NAME }} | |
ghcr.io/${{ github.repository }} | |
- name: Build and push Docker images | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |