Skip to content

Commit

Permalink
trying something new
Browse files Browse the repository at this point in the history
  • Loading branch information
siddheshraze committed Feb 27, 2024
1 parent 65fd181 commit 7bf0a72
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Alternate Testing Workflow

on:
push:
branches:
- new-file-upload-system
workflow_dispatch:

jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: development

steps:
- uses: actions/checkout@v4

- name: Set up Node.js version
uses: actions/setup-node@v3
with:
node-version: '18.x'

- name: create env file (now moved to base directory)
run: |
touch .env
echo AZURE_AD_CLIENT_SECRET=${{ secrets.AZURE_AD_CLIENT_SECRET }} >> .env
echo AZURE_AD_CLIENT_ID=${{ secrets.AZURE_AD_CLIENT_ID }} >> .env
echo AZURE_AD_TENANT_ID=${{ secrets.AZURE_AD_TENANT_ID }} >> .env
echo NEXTAUTH_SECRET=${{ secrets.NEXTAUTH_SECRET }} >> .env
echo AZURE_SQL_USER=${{ secrets.AZURE_SQL_USER }} >> .env
echo AZURE_SQL_PASSWORD=${{ secrets.AZURE_SQL_PASSWORD }} >> .env
echo AZURE_SQL_SERVER=${{ secrets.AZURE_SQL_SERVER }} >> .env
echo AZURE_SQL_DATABASE=${{ secrets.AZURE_SQL_DATABASE }} >> .env
echo AZURE_SQL_PORT=${{ secrets.AZURE_SQL_PORT }} >> .env
echo AZURE_STORAGE_SAS_CONNECTION_STRING=${{ secrets.AZURE_STORAGE_SAS_CONNECTION_STRING }} >> .env
echo AZURE_SQL_SCHEMA=${{ secrets.AZURE_SQL_SCHEMA }} >> .env
echo AZURE_STORAGE_CONNECTION_STRING=${{ secrets.AZURE_STORAGE_CONNECTION_STRING }} >> .env
echo NODE_ENV=development >> .env
echo PORT=3000 >> .env
- name: Cache node modules
uses: actions/cache@v2
with:
path: frontend/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: remove backend and legacy dirs --> not needed for app execution
run: |
rm -rf backend/
rm -rf frontend/
- name: move all files from frontend/ into base directory
run: |
mv frontend/* .
rm -rf frontend/
ls -altr
- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm run test --if-present
mv ./build/static ./build/standalone/build
mv ./public ./build/standalone
- name: 'Deploy to Azure Web App'
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: 'forestgeo-livesite'
slot-name: 'Production'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_852346BD764D45D08854E6679137F844 }}
package: ./build/standalone
15 changes: 11 additions & 4 deletions .github/workflows/new-file-upload-system_forestgeo-livesite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
node-version: '18.x'

- name: create frontend env file
- name: create env file (now moved to base directory)
run: |
touch .env
echo AZURE_AD_CLIENT_SECRET=${{ secrets.AZURE_AD_CLIENT_SECRET }} >> frontend/.env
Expand All @@ -48,12 +48,19 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- name: npm install, build, and test
- name: remove backend and legacy dirs --> not needed for app execution
run: |
rm -rf backend/
rm -rf legacy/
rm -rf frontend/
- name: move all files from frontend/ into base directory
run: |
mv frontend/* .
ls -a
rm -rf frontend/
ls -altr
- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm run test --if-present
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ next-env.d.ts
.idea/*
.vscode/*
/*.zip
.github/workflows/new-file-upload-system_forestgeo-livesite.yml
2 changes: 2 additions & 0 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const nextConfig = {
},
},
output: 'standalone',
reactStrictMode: true,
distDir: "build",
}

module.exports = nextConfig

0 comments on commit 7bf0a72

Please sign in to comment.