Skip to content

Commit

Permalink
Merge branch 'CommsJKUAT:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
franfreezy authored Dec 3, 2024
2 parents 9cc192a + 04e250a commit 8ba36c7
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 6 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/azure-static-web-apps-lively-mud-042177e03.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

name: Azure Static Web Apps CI/CD

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- main

jobs:
build_and_deploy_job:
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:
fetch-depth: 0
submodules: true
- name: Debug Directory Structure
run: ls -R
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Dependencies
run: |
cd frontend
npm install
- name: Build Application
run: |
cd frontend
npm run build
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_LIVELY_MUD_042177E03 }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: "upload"
app_location: "./frontend"
output_location: './frontend/dist'


close_pull_request_job:
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: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_LIVELY_MUD_042177E03 }}
action: "close"
13 changes: 7 additions & 6 deletions .github/workflows/main_agrixcubesat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ jobs:
DEBUG: "True"
run: |
cd AgritechSat
echo $MAPBOX
echo $DATABASECREDS
echo $SECRET_KEY
python manage.py check
python manage.py migrate
python manage.py collectstatic --noinput
- name: Zip artifact for deployment
run: |
cd AgritechSat
Expand Down Expand Up @@ -78,7 +77,9 @@ jobs:
name: python-app

- name: Unzip artifact for deployment
run: unzip release.zip
run: |
unzip release.zip
ls -la
- name: Login to Azure
Expand Down
8 changes: 8 additions & 0 deletions staticwebapp.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"routes": [
{
"route": "/*",
"rewrite": "/index.html"
}
]
}

0 comments on commit 8ba36c7

Please sign in to comment.