Skip to content

Commit ed35efd

Browse files
authored
Merge pull request #681 from microsoft/dev
feat: content generator
2 parents 5203b24 + 3cc822e commit ed35efd

446 files changed

Lines changed: 67926 additions & 126 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"build": {
44
"dockerfile": "Dockerfile"
55
},
6-
"forwardPorts": [50505],
6+
"forwardPorts": [3000, 5000],
77
"features": {
88
"ghcr.io/devcontainers/features/node:1": {
99
"nodeGypDependencies": true,

.devcontainer/setup_env.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@
22

33
git fetch
44
git pull
5-
6-
# provide execute permission to quotacheck script
7-
sudo chmod +x ./scripts/quota_check_params.sh

.github/workflows/azure-dev.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Azure Template Validation
22
on:
3-
workflow_dispatch:
3+
workflow_dispatch:
44

55
permissions:
66
contents: read
@@ -15,20 +15,21 @@ jobs:
1515
steps:
1616
# Step 1: Checkout the code from your repository
1717
- name: Checkout code
18-
uses: actions/checkout@v6
18+
uses: actions/checkout@v4
1919

2020
# Step 2: Validate the Azure template using microsoft/template-validation-action
2121
- name: Validate Azure Template
22-
uses: microsoft/template-validation-action@v0.4.4
22+
uses: microsoft/template-validation-action@v0.4.3
2323
id: validation
24+
with:
25+
workingDirectory: ./content-gen
2426
env:
2527
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
2628
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
2729
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
2830
AZURE_ENV_NAME: ${{ secrets.AZURE_ENV_NAME }}
2931
AZURE_LOCATION: ${{ secrets.AZURE_LOCATION }}
3032
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31-
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
3233

3334
# Step 3: Print the result of the validation
3435
- name: Print result
Lines changed: 66 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,66 @@
1-
on:
2-
push:
3-
branches:
4-
- main
5-
6-
permissions:
7-
contents: write
8-
pull-requests: write
9-
10-
name: Create-Release
11-
12-
jobs:
13-
create-release:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v6
18-
with:
19-
ref: ${{ github.event.workflow_run.head_sha }}
20-
21-
- uses: codfish/semantic-release-action@v4
22-
id: semantic
23-
with:
24-
tag-format: 'v${version}'
25-
additional-packages: |
26-
['conventional-changelog-conventionalcommits@7']
27-
plugins: |
28-
[
29-
[
30-
"@semantic-release/commit-analyzer",
31-
{
32-
"preset": "conventionalcommits"
33-
}
34-
],
35-
[
36-
"@semantic-release/release-notes-generator",
37-
{
38-
"preset": "conventionalcommits",
39-
"presetConfig": {
40-
"types": [
41-
{ type: 'feat', section: 'Features', hidden: false },
42-
{ type: 'fix', section: 'Bug Fixes', hidden: false },
43-
{ type: 'perf', section: 'Performance Improvements', hidden: false },
44-
{ type: 'revert', section: 'Reverts', hidden: false },
45-
{ type: 'docs', section: 'Other Updates', hidden: false },
46-
{ type: 'style', section: 'Other Updates', hidden: false },
47-
{ type: 'chore', section: 'Other Updates', hidden: false },
48-
{ type: 'refactor', section: 'Other Updates', hidden: false },
49-
{ type: 'test', section: 'Other Updates', hidden: false },
50-
{ type: 'build', section: 'Other Updates', hidden: false },
51-
{ type: 'ci', section: 'Other Updates', hidden: false }
52-
]
53-
}
54-
}
55-
],
56-
'@semantic-release/github'
57-
]
58-
env:
59-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60-
- run: echo ${{ steps.semantic.outputs.release-version }}
61-
62-
- run: echo "$OUTPUTS"
63-
env:
64-
OUTPUTS: ${{ toJson(steps.semantic.outputs) }}
1+
name: "Create Release"
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
create-release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.sha }}
21+
22+
- uses: codfish/semantic-release-action@v3
23+
id: semantic
24+
with:
25+
tag-format: 'v${version}'
26+
additional-packages: |
27+
['conventional-changelog-conventionalcommits@7']
28+
plugins: |
29+
[
30+
[
31+
"@semantic-release/commit-analyzer",
32+
{
33+
"preset": "conventionalcommits"
34+
}
35+
],
36+
[
37+
"@semantic-release/release-notes-generator",
38+
{
39+
"preset": "conventionalcommits",
40+
"presetConfig": {
41+
"types": [
42+
{ type: 'feat', section: 'Features', hidden: false },
43+
{ type: 'fix', section: 'Bug Fixes', hidden: false },
44+
{ type: 'perf', section: 'Performance Improvements', hidden: false },
45+
{ type: 'revert', section: 'Reverts', hidden: false },
46+
{ type: 'docs', section: 'Other Updates', hidden: false },
47+
{ type: 'style', section: 'Other Updates', hidden: false },
48+
{ type: 'chore', section: 'Other Updates', hidden: false },
49+
{ type: 'refactor', section: 'Other Updates', hidden: false },
50+
{ type: 'test', section: 'Other Updates', hidden: false },
51+
{ type: 'build', section: 'Other Updates', hidden: false },
52+
{ type: 'ci', section: 'Other Updates', hidden: false }
53+
]
54+
}
55+
}
56+
],
57+
'@semantic-release/github'
58+
]
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
62+
- run: echo ${{ steps.semantic.outputs.release-version }}
63+
64+
- run: echo "$OUTPUTS"
65+
env:
66+
OUTPUTS: ${{ toJson(steps.semantic.outputs) }}

.github/workflows/docker-build.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Build Docker and Optional Push - Content Generation Solution Accelerator
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
- demo
9+
paths:
10+
- 'content-gen/src/backend/**'
11+
- 'content-gen/src/app/frontend/**'
12+
- 'content-gen/src/app/frontend-server/**'
13+
- '.github/workflows/docker-build.yml'
14+
pull_request:
15+
types:
16+
- opened
17+
- ready_for_review
18+
- reopened
19+
- synchronize
20+
branches:
21+
- main
22+
- dev
23+
- demo
24+
paths:
25+
- 'content-gen/src/backend/**'
26+
- 'content-gen/src/app/frontend/**'
27+
- 'content-gen/src/app/frontend-server/**'
28+
- '.github/workflows/docker-build.yml'
29+
workflow_dispatch:
30+
31+
permissions:
32+
contents: read
33+
actions: read
34+
jobs:
35+
build-and-push:
36+
runs-on: ubuntu-latest
37+
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/checkout@v4
41+
42+
- name: Set up Docker Buildx
43+
uses: docker/setup-buildx-action@v3
44+
45+
- name: Log in to Azure Container Registry
46+
if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo')) || (github.event_name == 'workflow_dispatch' && (github.ref_name == 'dependabotchanges'||github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo')) }}
47+
uses: azure/docker-login@v2
48+
with:
49+
login-server: ${{ secrets.ACR_LOGIN_SERVER }}
50+
username: ${{ secrets.ACR_USERNAME }}
51+
password: ${{ secrets.ACR_PASSWORD }}
52+
53+
- name: Get current date
54+
id: date
55+
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
56+
57+
- name: Output ACR Login Server
58+
run: |
59+
echo "ACR Login Server: ${{ secrets.ACR_LOGIN_SERVER }}"
60+
61+
- name: Determine Tag Name Based on Branch
62+
id: determine_tag
63+
run: |
64+
if [[ "${{ github.ref_name }}" == "main" ]]; then
65+
echo "tagname=latest" >> $GITHUB_OUTPUT
66+
elif [[ "${{ github.ref_name }}" == "dev" ]]; then
67+
echo "tagname=dev" >> $GITHUB_OUTPUT
68+
elif [[ "${{ github.ref_name }}" == "demo" ]]; then
69+
echo "tagname=demo" >> $GITHUB_OUTPUT
70+
elif [[ "${{ github.ref_name }}" == "dependabotchanges" ]]; then
71+
echo "tagname=dependabotchanges" >> $GITHUB_OUTPUT
72+
else
73+
echo "tagname=default" >> $GITHUB_OUTPUT
74+
75+
fi
76+
- name: Build and Push Docker Image for Frontend Server
77+
uses: docker/build-push-action@v6
78+
with:
79+
context: ./content-gen/src/app
80+
file: ./content-gen/src/app/WebApp.Dockerfile
81+
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'dependabotchanges' }}
82+
tags: |
83+
${{ secrets.ACR_LOGIN_SERVER || 'acrlogin.azurecr.io' }}/content-gen-app:${{ steps.determine_tag.outputs.tagname }}
84+
${{ secrets.ACR_LOGIN_SERVER || 'acrlogin.azurecr.io' }}/content-gen-app:${{ steps.determine_tag.outputs.tagname }}_${{ steps.date.outputs.date }}_${{ github.run_number }}
85+
86+
- name: Build and Push Docker Image for Backend Server
87+
uses: docker/build-push-action@v6
88+
with:
89+
context: ./content-gen/src/backend
90+
file: ./content-gen/src/backend/ApiApp.Dockerfile
91+
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'dependabotchanges' }}
92+
tags: |
93+
${{ secrets.ACR_LOGIN_SERVER || 'acrlogin.azurecr.io' }}/content-gen-api:${{ steps.determine_tag.outputs.tagname }}
94+
${{ secrets.ACR_LOGIN_SERVER || 'acrlogin.azurecr.io' }}/content-gen-api:${{ steps.determine_tag.outputs.tagname }}_${{ steps.date.outputs.date }}_${{ github.run_number }}

.gitignore

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,73 @@
1+
# Virtual environments
12
.venv
3+
venv
4+
myenv
5+
scriptsenv/
6+
scriptenv
27

8+
# Environment files with secrets
39
.env
10+
.env.local
11+
.env.*.local
12+
*.env
13+
14+
# Azure
415
.azure/
16+
17+
# Python
518
__pycache__/
19+
*.py[cod]
20+
*$py.class
21+
*.so
22+
.Python
23+
*.egg-info/
24+
dist/
25+
build/
26+
eggs/
27+
*.egg
28+
29+
# Jupyter
630
.ipynb_checkpoints/
731

32+
# IDE
33+
.vscode/
34+
.idea/
35+
*.swp
36+
*.swo
837

9-
venv
10-
myenv
38+
# Node
39+
/content-gen/src/app/frontend/node_modules/
40+
/content-gen/src/app/frontend-server/node_modules/
41+
/content-gen/src/app/frontend-server/static/
42+
/content-gen/src/app/frontend-server/*.zip
43+
node_modules/
1144

12-
scriptsenv/
45+
# Build output
46+
/content-gen/src/app/static/
47+
/content-gen/src/app/frontend/dist/
1348

14-
scriptenv
15-
pdf
49+
# Logs
50+
*.log
51+
logs/
52+
53+
# Keys and credentials
54+
*.pem
55+
*.key
56+
*.pfx
57+
*.p12
58+
*secret*
59+
*credential*
60+
61+
# OS files
62+
.DS_Store
63+
Thumbs.db
64+
65+
# Misc
66+
pdf
67+
*.bak
68+
*.tmp
69+
*.zip
70+
71+
# RAI evaluation results
72+
rai_results/
73+
**/rai_results/

0 commit comments

Comments
 (0)