Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main #8

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
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
81 changes: 81 additions & 0 deletions .github/workflows/api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: API Deployment

env:
registryName: op3eqv3gu7pvecosureg.azurecr.io
repositoryName: techexcel/csapi
dockerFolderPath: ./src/ContosoSuitesWebAPI
tag: ${{github.run_number}}

on:
push:
branches: [ main ]
paths: src/ContosoSuitesWebAPI/**
pull_request:
branches: [ main ]
paths: src/ContosoSuitesWebAPI/**
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0

- name: Restore dependencies
run: dotnet restore ./src/ContosoSuitesWebAPI/ContosoSuitesWebAPI.csproj
- name: Build
run: dotnet build --no-restore ./src/ContosoSuitesWebAPI/ContosoSuitesWebAPI.csproj

dockerBuildPush:
runs-on: ubuntu-latest
needs: build

steps:
- uses: actions/checkout@v4

- name: Docker Login
# You may pin to the exact commit or the version.
# uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
uses: docker/login-action@v3
with:
# Server address of Docker registry. If not set then will default to Docker Hub
registry: ${{ secrets.ACR_LOGIN_SERVER }}
# Username used to log against the Docker registry
username: ${{ secrets.ACR_USERNAME }}
# Password or personal access token used to log against the Docker registry
password: ${{ secrets.ACR_PASSWORD }}
# Log out from the Docker registry at the end of a job
logout: true

- name: Docker Build
run: docker build -t $registryName/$repositoryName:$tag --build-arg build_version=$tag $dockerFolderPath

- name: Docker Push
run: docker push $registryName/$repositoryName:$tag

deploy-to-prod:

runs-on: ubuntu-latest
needs: dockerBuildPush
environment:
name: prod
url: https://op3eqv3gu7pve-api.azurewebsites.net/

steps:
- uses: actions/checkout@v4

- name: 'Login via Azure CLI'
uses: azure/[email protected]
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- uses: azure/webapps-deploy@v2
with:
app-name: 'op3eqv3gu7pve-api'
images: op3eqv3gu7pvecosureg.azurecr.io/techexcel/csapi:${{github.run_number}}
70 changes: 70 additions & 0 deletions .github/workflows/dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Dashboard Deployment

env:
registryName: op3eqv3gu7pvecosureg.azurecr.io
repositoryName: techexcel/csdash
dockerFolderPath: ./src/ContosoSuitesDashboard
tag: ${{github.run_number}}

on:
push:
branches: [ main ]
paths: src/ContosoSuitesDashboard/**
pull_request:
branches: [ main ]
paths: src/ContosoSuitesDashboard/**
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
dockerBuildPush:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Docker Login
# You may pin to the exact commit or the version.
# uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
uses: docker/login-action@v3
with:
# Server address of Docker registry. If not set then will default to Docker Hub
registry: ${{ secrets.ACR_LOGIN_SERVER }}
# Username used to log against the Docker registry
username: ${{ secrets.ACR_USERNAME }}
# Password or personal access token used to log against the Docker registry
password: ${{ secrets.ACR_PASSWORD }}
# Log out from the Docker registry at the end of a job
logout: true

- name: Create Secrets File
run: echo "$STREAMLIT_SECRETS" > ./src/ContosoSuitesDashboard/.streamlit/secrets.toml
shell: bash
env:
STREAMLIT_SECRETS: ${{ secrets.STREAMLIT_SECRETS }}

- name: Docker Build
run: docker build -t $registryName/$repositoryName:$tag --build-arg build_version=$tag $dockerFolderPath

- name: Docker Push
run: docker push $registryName/$repositoryName:$tag

deploy-to-prod:

runs-on: ubuntu-latest
needs: dockerBuildPush
environment:
name: prod
url: https://op3eqv3gu7pve-dash.azurewebsites.net/

steps:
- uses: actions/checkout@v4

- name: 'Login via Azure CLI'
uses: azure/[email protected]
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- uses: azure/webapps-deploy@v2
with:
app-name: 'op3eqv3gu7pve-dash'
images: op3eqv3gu7pvecosureg.azurecr.io/techexcel/csdash:${{github.run_number}}
57 changes: 0 additions & 57 deletions .github/workflows/jekyll-gh-pages.yml

This file was deleted.

20 changes: 10 additions & 10 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to .NET Functions",
"type": "coreclr",
"request": "attach",
"processId": "${command:azureFunctions.pickProcess}"
}
]
}
"version": "0.2.0",
"configurations": [
{
"name": "Attach to .NET Functions",
"type": "coreclr",
"request": "attach",
"processId": "${command:azureFunctions.pickProcess}"
}
]
}
160 changes: 80 additions & 80 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,81 +1,81 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "clean (functions)",
"command": "dotnet",
"args": [
"clean",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"problemMatcher": "$msCompile",
"options": {
"cwd": "${workspaceFolder}/src\\ContosoSuitesVectorizationFunction"
}
},
{
"label": "build (functions)",
"command": "dotnet",
"args": [
"build",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"dependsOn": "clean (functions)",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$msCompile",
"options": {
"cwd": "${workspaceFolder}/src\\ContosoSuitesVectorizationFunction"
}
},
{
"label": "clean release (functions)",
"command": "dotnet",
"args": [
"clean",
"--configuration",
"Release",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"problemMatcher": "$msCompile",
"options": {
"cwd": "${workspaceFolder}/src\\ContosoSuitesVectorizationFunction"
}
},
{
"label": "publish (functions)",
"command": "dotnet",
"args": [
"publish",
"--configuration",
"Release",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"dependsOn": "clean release (functions)",
"problemMatcher": "$msCompile",
"options": {
"cwd": "${workspaceFolder}/src\\ContosoSuitesVectorizationFunction"
}
},
{
"type": "func",
"dependsOn": "build (functions)",
"options": {
"cwd": "${workspaceFolder}/src/ContosoSuitesVectorizationFunction/bin/Debug/net8.0"
},
"command": "host start",
"isBackground": true,
"problemMatcher": "$func-dotnet-watch"
}
]
}
"version": "2.0.0",
"tasks": [
{
"label": "clean (functions)",
"command": "dotnet",
"args": [
"clean",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"problemMatcher": "$msCompile",
"options": {
"cwd": "${workspaceFolder}/src\\ContosoSuitesVectorizationFunction"
}
},
{
"label": "build (functions)",
"command": "dotnet",
"args": [
"build",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"dependsOn": "clean (functions)",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$msCompile",
"options": {
"cwd": "${workspaceFolder}/src\\ContosoSuitesVectorizationFunction"
}
},
{
"label": "clean release (functions)",
"command": "dotnet",
"args": [
"clean",
"--configuration",
"Release",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"problemMatcher": "$msCompile",
"options": {
"cwd": "${workspaceFolder}/src\\ContosoSuitesVectorizationFunction"
}
},
{
"label": "publish (functions)",
"command": "dotnet",
"args": [
"publish",
"--configuration",
"Release",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"dependsOn": "clean release (functions)",
"problemMatcher": "$msCompile",
"options": {
"cwd": "${workspaceFolder}/src\\ContosoSuitesVectorizationFunction"
}
},
{
"type": "func",
"dependsOn": "build (functions)",
"options": {
"cwd": "${workspaceFolder}/src/ContosoSuitesVectorizationFunction/bin/Debug/net8.0"
},
"command": "host start",
"isBackground": true,
"problemMatcher": "$func-dotnet-watch"
}
]
}
Loading
Loading