Skip to content

ci: Update dotnet.yml #23

ci: Update dotnet.yml

ci: Update dotnet.yml #23

Workflow file for this run

name: .NET
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
environment:
name: actions_back_front_orange_finance
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Semantic Release
id: semantic_release
uses: cycjimmy/semantic-release-action@v4
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Extract and format release version
run: echo "NEXT_VERSION=${{ steps.semantic_release.outputs.newReleaseVersion#v }}" | sed 's/^v//' >> $GITHUB_ENV

Check failure on line 28 in .github/workflows/dotnet.yml

View workflow run for this annotation

GitHub Actions / .NET

Invalid workflow file

The workflow is not valid. .github/workflows/dotnet.yml (Line: 28, Col: 14): Unexpected symbol: 'newReleaseVersion#v'. Located at position 32 within expression: steps.semantic_release.outputs.newReleaseVersion#v
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x
- name: Restore dependencies
run: dotnet restore Back-Orange-Finance/Orange-Finance/OrangeFinance.csproj
- name: Build application
run: dotnet build Back-Orange-Finance/Orange-Finance/OrangeFinance.csproj --no-restore --configuration Release
- name: Publish application
run: dotnet publish Back-Orange-Finance/Orange-Finance/OrangeFinance.csproj --no-build --configuration Release -o out
- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: Back-Orange-Finance
file: Back-Orange-Finance/Orange-Finance/Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/orange-finance-backend:${{ env.NEXT_VERSION }}
- name: Scan Docker image for vulnerabilities
uses: aquasecurity/[email protected]
with:
image-ref: ${{ secrets.DOCKER_USERNAME }}/orange-finance-backend:${{ env.NEXT_VERSION }}