diff --git a/.github/workflows/main_chatbot2222.yml b/.github/workflows/main_chatbot2222.yml index d116133..dbc3274 100644 --- a/.github/workflows/main_chatbot2222.yml +++ b/.github/workflows/main_chatbot2222.yml @@ -1,8 +1,4 @@ -# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy -# More GitHub Actions for Azure: https://github.com/Azure/actions -# More info on Python, GitHub Actions, and Azure App Service: https://aka.ms/python-webapps-actions - -name: Build and deploy Python app to Azure Web App - ChatBot2222 +name: Build and deploy Node.js app to Azure Web App - ChatBot2222 on: push: @@ -13,69 +9,42 @@ on: jobs: build: runs-on: ubuntu-latest - permissions: - contents: read #This is required for actions/checkout - steps: - uses: actions/checkout@v4 - - name: Set up Python version - uses: actions/setup-python@v5 + - name: Set up Node.js + uses: actions/setup-node@v3 with: - python-version: '3.11' + node-version: '20.x' - - name: Create and start virtual environment - run: | - python -m venv venv - source venv/bin/activate - - - name: Install dependencies - run: pip install -r requirements.txt - - # Optional: Add step to run tests here (PyTest, Django test suites, etc.) - - - name: Zip artifact for deployment - run: zip release.zip ./* -r - - - name: Upload artifact for deployment jobs - uses: actions/upload-artifact@v4 - with: - name: python-app - path: | - release.zip - !venv/ + - run: npm install + - run: npm run build --if-present deploy: runs-on: ubuntu-latest needs: build - environment: - name: 'Production' + environment: + name: 'Production' url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} - permissions: - id-token: write #This is required for requesting the JWT - contents: read #This is required for actions/checkout + permissions: + id-token: write + contents: read steps: - - name: Download artifact from build job - uses: actions/download-artifact@v4 + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Azure Login + uses: azure/login@v2 with: - name: python-app - - - name: Unzip artifact for deployment - run: unzip release.zip - - - - name: Login to Azure - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_83E5C15B3554434EB977889D53288D32 }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_A854D646F01143CF80F36F397E454234 }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_1DE245411FAB4A58997C9D2D9248BF4A }} - - - name: 'Deploy to Azure Web App' - uses: azure/webapps-deploy@v3 + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + - name: Deploy to Azure Web App id: deploy-to-webapp + uses: azure/webapps-deploy@v2 with: app-name: 'ChatBot2222' - slot-name: 'Production' - \ No newline at end of file + publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_CHATBOT2222 }} + package: .