Skip to content

Commit fd4b4ed

Browse files
committed
fix: update actions yml file
1 parent 988664e commit fd4b4ed

1 file changed

Lines changed: 24 additions & 18 deletions

File tree

.github/workflows/main_webapptest12.yml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,53 +13,59 @@ jobs:
1313
build:
1414
runs-on: ubuntu-latest
1515
permissions:
16-
contents: read #This is required for actions/checkout
16+
contents: read
1717

1818
steps:
1919
- uses: actions/checkout@v4
2020

2121
- name: Set up Node.js version
22-
uses: actions/setup-node@v3
22+
uses: actions/setup-node@v4
2323
with:
24-
node-version: '24.x'
24+
node-version: '20.x' # Node 24 is very new; LTS (20 or 22) is highly recommended for Azure stability
2525

26+
# Next.js requires environment variables to be present during the build step
2627
- name: npm install, build, and test
28+
env:
29+
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
30+
MONGODB_URI: ${{ secrets.MONGODB_URI }}
2731
run: |
28-
npm install
32+
npm install --force
2933
npm run build --if-present
30-
npm run test --if-present
3134
35+
# Upload everything, explicitly ensuring hidden folders like .next are included
3236
- name: Upload artifact for deployment job
3337
uses: actions/upload-artifact@v4
3438
with:
3539
name: node-app
36-
path: .
40+
path: |
41+
.
42+
!.git
43+
!.github
3744
3845
deploy:
3946
runs-on: ubuntu-latest
4047
needs: build
41-
permissions:
42-
id-token: write #This is required for requesting the JWT
43-
contents: read #This is required for actions/checkout
48+
permissions:
49+
id-token: write
50+
contents: read
4451

4552
steps:
4653
- name: Download artifact from build job
4754
uses: actions/download-artifact@v4
4855
with:
4956
name: node-app
50-
51-
- name: Login to Azure
52-
uses: azure/login@v2
53-
with:
54-
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_239DF755F5D44D488A1BA7F11F8E11CE }}
55-
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_CE3F19026FB64F93BDD7586B095297F2 }}
56-
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_614D15EC0D18401280F839AA38E6AEFF }}
57+
58+
- name: Login to Azure
59+
uses: azure/login@v2
60+
with:
61+
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_239DF755F5D44D488A1BA7F11F8E11CE }}
62+
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_CE3F19026FB64F93BDD7586B095297F2 }}
63+
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_614D15EC0D18401280F839AA38E6AEFF }}
5764

5865
- name: 'Deploy to Azure Web App'
5966
id: deploy-to-webapp
6067
uses: azure/webapps-deploy@v3
6168
with:
6269
app-name: 'webapptest12'
6370
slot-name: 'Production'
64-
package: .
65-
71+
package: .

0 commit comments

Comments
 (0)