Skip to content
Merged

Cd2 #11

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 41 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

on:
push:
branches:
- main
branches: ["main"]

jobs:
Expand All @@ -10,7 +12,8 @@
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up .NET Core
uses: actions/setup-dotnet@v4
Expand All @@ -25,15 +28,49 @@
- name: dotnet test
run: dotnet test --configuration Release --no-restore

- name: dotnet publish
- name: Restore dependencies
run: dotnet restore --locked-mode

- name: Run tests
run: dotnet test --configuration Release --no-restore

- name: Publish application
run: dotnet publish src/GitHubActionsDotNet.Api/GitHubActionsDotNet.Api.csproj --configuration Release -o artifacts

- uses: actions/upload-artifact@v4
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dometrain-artifact
path: artifacts/

deploy_dev:
name: Deploy Dev
runs-on: ubuntu-latest
needs: build

steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: dometrain-artifact
path: artifacts/

- name: Azure login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Deploy to Azure App Service
uses: azure/webapps-deploy@v2
with:
app-name: app-dometrain-github-actions-erisjakupi-dev
package: artifacts/
name: dometrain-artifact
path: artifacts/

deploy_dev:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
name: Deploy Dev
runs-on: ubuntu-latest
needs: build
Expand All @@ -49,4 +86,4 @@
with:
app-name: app-dometrain-github-actions-erisjakupi-dev
package: artifacts/