diff --git a/.github/workflows/build-docker-images.yml b/.github/workflows/build-docker-images.yml
index 48f29b13..08e82af1 100644
--- a/.github/workflows/build-docker-images.yml
+++ b/.github/workflows/build-docker-images.yml
@@ -22,7 +22,7 @@ jobs:
# registry: bycwacontainerreg.azurecr.io
# username: bycwacontainerreg
- - app_name: byoaia-app
+ - app_name: byoaires-app
dockerfile: ResearchAssistant/App/WebApp.Dockerfile
registry: resasscontainerreg.azurecr.io
username: resasscontainerreg
@@ -33,5 +33,5 @@ jobs:
username: ${{ matrix.username }}
app_name: ${{ matrix.app_name }}
dockerfile: ${{ matrix.dockerfile }}
- push: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main' }}
+ push: ${{ github.event.workflow_run.head_branch == 'main' }}
secrets: inherit
diff --git a/test/ci.yml b/test/ci.yml
new file mode 100644
index 00000000..8edfe895
--- /dev/null
+++ b/test/ci.yml
@@ -0,0 +1,93 @@
+name: CI
+
+on:
+ push:
+ branches:
+ - main
+ schedule:
+ - cron: '0 6,18 * * *' # Runs at 6:00 AM and 6:00 PM GMT
+
+permissions:
+ contents: read
+ packages: write
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+
+jobs:
+ ci:
+ runs-on: ubuntu-latest
+ env:
+ AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
+ AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
+ AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
+ AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Login to GitHub Container Registry
+ uses: docker/login-action@v3
+ with:
+ registry: ghcr.io
+ username: ${{ github.repository_owner }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Pre-build image and run make in dev container
+ uses: devcontainers/ci@v0.3
+ env:
+ AZURE_ENV_NAME: ${{ github.run_id }}
+ AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
+ AZURE_RESOURCE_GROUP: ${{ vars.AZURE_RESOURCE_GROUP }}
+ with:
+ imageName: ghcr.io/roopan-microsoft/psl-cwyd-main
+ cacheFrom: ghcr.io/roopan-microsoft/psl-cwyd-main
+ runCmd: make ci && make deploy
+ refFilterForPush: refs/heads/main
+ env: |
+ AZURE_CLIENT_ID
+ AZURE_CLIENT_SECRET
+ AZURE_TENANT_ID
+ AZURE_SUBSCRIPTION_ID
+ AZURE_ENV_NAME
+ AZURE_LOCATION
+ AZURE_RESOURCE_GROUP
+
+ - name: Tidy up
+ uses: devcontainers/ci@v0.3
+ if: always()
+ env:
+ AZURE_ENV_NAME: ${{ github.run_id }}
+ AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
+ AZURE_RESOURCE_GROUP: ${{ vars.AZURE_RESOURCE_GROUP }}
+ with:
+ push: never
+ imageName: ghcr.io/roopan-microsoft/psl-cwyd-main
+ runCmd: make destroy
+ env: |
+ AZURE_CLIENT_ID
+ AZURE_CLIENT_SECRET
+ AZURE_TENANT_ID
+ AZURE_SUBSCRIPTION_ID
+ AZURE_ENV_NAME
+ AZURE_LOCATION
+ AZURE_RESOURCE_GROUP
+
+ - name: Send Notification on Failure
+ if: failure()
+ run: |
+ RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
+
+ # Construct the email body
+ EMAIL_BODY=$(cat <
We would like to inform you that the CWYD Automation process has encountered an issue and has failed to complete successfully.
Build URL: ${RUN_URL}
${OUTPUT}
Please investigate the matter at your earliest convenience.
Best regards,
Your Automation Team