From 8ad5a10709369b0e39d5eaaffbf3d0386852275e Mon Sep 17 00:00:00 2001 From: Gabriel Coloma Date: Tue, 12 Mar 2024 23:07:19 -0500 Subject: [PATCH 1/6] Change typo --- .github/workflows/AzureDeployBackend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/AzureDeployBackend.yml b/.github/workflows/AzureDeployBackend.yml index 0efc38b..347ba2d 100644 --- a/.github/workflows/AzureDeployBackend.yml +++ b/.github/workflows/AzureDeployBackend.yml @@ -36,7 +36,7 @@ jobs: - name: Collect static files run: | - cd backend + cd lvlgg_backend python manage.py collectstatic --noinput # Optional: Add step to run tests here (PyTest, Django test suites, etc.) From e3ea3f28b3359a544face9238124a5e521e0dbc3 Mon Sep 17 00:00:00 2001 From: Gabriel Coloma Date: Thu, 14 Mar 2024 09:57:22 -0500 Subject: [PATCH 2/6] Added django-cors-headers --- lvlgg_backend/requirements.txt | Bin 506 -> 562 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/lvlgg_backend/requirements.txt b/lvlgg_backend/requirements.txt index ffb925536e99169e6e1106ad9fb604761e3dc636..a69650ced629e9303414ba54c5b5ed125f78faa6 100644 GIT binary patch delta 50 zcmeyxyoqIkkGd{HGDAK?5koP9E<*-GDnlYe3XlZxZGq5)L65;0hz&Pd?`H%6EIA6k delta 10 RcmdnQ@{4(b&&HN@i~t#s1atrZ From 4a792577cc4c14b9afeaa7fb2c745e2e5e4c8ae7 Mon Sep 17 00:00:00 2001 From: Gabriel Coloma Date: Thu, 14 Mar 2024 10:10:44 -0500 Subject: [PATCH 3/6] Added AzureDeployFrontend.yml --- .github/workflows/AzureDeployFrontend.yml | 70 +++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/AzureDeployFrontend.yml diff --git a/.github/workflows/AzureDeployFrontend.yml b/.github/workflows/AzureDeployFrontend.yml new file mode 100644 index 0000000..79e8bb0 --- /dev/null +++ b/.github/workflows/AzureDeployFrontend.yml @@ -0,0 +1,70 @@ +# This workflow will build and push a web application to an Azure Static Web App when you change your code. +# +# This workflow assumes you have already created the target Azure Static Web App. +# For instructions see https://docs.microsoft.com/azure/static-web-apps/get-started-portal?tabs=vanilla-javascript +# +# To configure this workflow: +# +# 1. Set up a secret in your repository named AZURE_STATIC_WEB_APPS_API_TOKEN with the value of your Static Web Apps deployment token. +# For instructions on obtaining the deployment token see: https://docs.microsoft.com/azure/static-web-apps/deployment-token-management +# +# 3. Change the values for the APP_LOCATION, API_LOCATION and APP_ARTIFACT_LOCATION, AZURE_STATIC_WEB_APPS_API_TOKEN environment variables (below). +# For instructions on setting up the appropriate configuration values go to https://docs.microsoft.com/azure/static-web-apps/front-end-frameworks +name: Deploy web app to Azure Static Web Apps + +on: + push: + branches: [ "master" ] + pull_request: + types: [opened, synchronize, reopened, closed] + branches: [ "master" ] + +# Environment variables available to all jobs and steps in this workflow +env: + APP_LOCATION: "/" # location of your client code + API_LOCATION: "api" # location of your api source code - optional + APP_ARTIFACT_LOCATION: "build" # location of client code build output + AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing deployment token for your static web app + +permissions: + contents: read + +jobs: + build_and_deploy_job: + permissions: + contents: read # for actions/checkout to fetch code + pull-requests: write # for Azure/static-web-apps-deploy to comment on PRs + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') + runs-on: ubuntu-latest + name: Build and Deploy Job + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Build And Deploy + id: builddeploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing api token for app + repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) + action: "upload" + ###### Repository/Build Configurations - These values can be configured to match you app requirements. ###### + # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig + app_location: ${{ env.APP_LOCATION }} + api_location: ${{ env.API_LOCATION }} + app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }} + ###### End of Repository/Build Configurations ###### + + close_pull_request_job: + permissions: + contents: none + if: github.event_name == 'pull_request' && github.event.action == 'closed' + runs-on: ubuntu-latest + name: Close Pull Request Job + steps: + - name: Close Pull Request + id: closepullrequest + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing api token for app + action: "close" From 97e521e57fa9e4e191151a8977e9c676d4fd2bc9 Mon Sep 17 00:00:00 2001 From: Gabriel Coloma Date: Thu, 14 Mar 2024 10:15:40 -0500 Subject: [PATCH 4/6] added django-cors-headers dependency in deploynbackend --- .github/workflows/AzureDeployBackend.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/AzureDeployBackend.yml b/.github/workflows/AzureDeployBackend.yml index 347ba2d..8851006 100644 --- a/.github/workflows/AzureDeployBackend.yml +++ b/.github/workflows/AzureDeployBackend.yml @@ -33,6 +33,8 @@ jobs: cd backend python -m pip install --upgrade pip pip install -r requirements.txt + python -m pip install django-cors-headers + - name: Collect static files run: | From d40373b0519faacc834d9770d9e403301641ae40 Mon Sep 17 00:00:00 2001 From: Gabriel Coloma Date: Thu, 14 Mar 2024 10:21:30 -0500 Subject: [PATCH 5/6] Added workflow_dispatch on frontenddeployment --- .github/workflows/AzureDeployFrontend.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/AzureDeployFrontend.yml b/.github/workflows/AzureDeployFrontend.yml index 79e8bb0..82601da 100644 --- a/.github/workflows/AzureDeployFrontend.yml +++ b/.github/workflows/AzureDeployFrontend.yml @@ -18,6 +18,7 @@ on: pull_request: types: [opened, synchronize, reopened, closed] branches: [ "master" ] + workflow_dispatch: # Environment variables available to all jobs and steps in this workflow env: From 38e94ff51d06f935a7ff7d9e7d70e2c304e9f3cd Mon Sep 17 00:00:00 2001 From: Gabriel Coloma Date: Thu, 14 Mar 2024 10:23:03 -0500 Subject: [PATCH 6/6] updated azuredeployfrontend --- .github/workflows/AzureDeployFrontend.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/AzureDeployFrontend.yml b/.github/workflows/AzureDeployFrontend.yml index 82601da..e607952 100644 --- a/.github/workflows/AzureDeployFrontend.yml +++ b/.github/workflows/AzureDeployFrontend.yml @@ -15,9 +15,6 @@ name: Deploy web app to Azure Static Web Apps on: push: branches: [ "master" ] - pull_request: - types: [opened, synchronize, reopened, closed] - branches: [ "master" ] workflow_dispatch: # Environment variables available to all jobs and steps in this workflow