Skip to content

Commit

Permalink
fix(Workflow): Added script file to start
Browse files Browse the repository at this point in the history
  • Loading branch information
wadhia-yash committed Jul 8, 2024
1 parent 0b1f20b commit f01a21a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 34 deletions.
47 changes: 14 additions & 33 deletions .github/workflows/web-app_web-app-prod.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy SvelteKit app to Azure Web App - web-app-prod
name: Build and deploy Node.js app to Azure Web App - web-app-prod

on:
push:
Expand All @@ -18,22 +18,16 @@ jobs:
with:
node-version: "18.x"

- name: Install dependencies and build SvelteKit app
- name: npm install, build, and test
run: |
cd commanddash_web_app
npm install
npm run build
- name: List build directory contents
run: |
cd commanddash_web_app
ls -la build
npm run build --if-present
npm run test --if-present
- name: Zip artifact for deployment
run: |
cd commanddash_web_app
zip -r ../release.zip build package.json package-lock.json
cd commanddash_web_app/build
zip -r ../../release.zip .
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v3
with:
Expand All @@ -47,7 +41,7 @@ jobs:
name: "Production"
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
permissions:
id-token: write # This is required for requesting the JWT
id-token: write #This is required for requesting the JWT

steps:
- name: Download artifact from build job
Expand All @@ -58,30 +52,17 @@ jobs:
- name: Unzip artifact for deployment
run: unzip release.zip -d deploy

- name: List deploy directory contents
run: |
ls -la deploy
- name: Login to Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_818727A488FB487EA3BCC61BEC337FDD }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_58CC6F3841FB49A38469650AD296DCC8 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_7B7BF9D41759471DBA0ED64C44AF88AE }}

- name: Install Node.js dependencies on Azure
run: |
cd deploy
npm install
- name: List deploy/build directory contents
run: |
ls -la deploy/build
- name: Install PM2
run: |
npm install -g pm2
- name: Start SvelteKit App
run: |
pm2 start deploy/build/index.js --name sveltekit-app --no-daemon
- name: "Deploy to Azure Web App"
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: "web-app-prod"
slot-name: "Production"
package: deploy
3 changes: 2 additions & 1 deletion commanddash_web_app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"start": "node deploy/build/index.js"
},
"devDependencies": {
"@iconify-json/carbon": "^1.1.36",
Expand Down

0 comments on commit f01a21a

Please sign in to comment.