Update main_chatbot2222.yml
This commit is contained in:
parent
e27820b4aa
commit
74975ea348
1 changed files with 24 additions and 55 deletions
79
.github/workflows/main_chatbot2222.yml
vendored
79
.github/workflows/main_chatbot2222.yml
vendored
|
|
@ -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'
|
||||
|
||||
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_CHATBOT2222 }}
|
||||
package: .
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue