aimpress-chatbot/.github/workflows/deploy.yml

51 lines
1.5 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Build and deploy Node.js app to Azure Web App - ChatBot2222
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Шаг 1: Клонирование кода из репозитория
- name: Checkout code
uses: actions/checkout@v4
# Шаг 2: Установка Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
# Шаг 3: Установка зависимостей
- run: npm install
# Шаг 4: Сборка проекта (если нужно)
- run: npm run build --if-present
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
permissions:
id-token: write
contents: read
steps:
# Шаг 1: Клонирование кода из репозитория для деплоя
- name: Checkout code
uses: actions/checkout@v2
# Шаг 2: Деплой с использованием Publish Profile
- name: Deploy to Azure Web App using Publish Profile
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: 'ChatBot2222' # Имя твоего Web App
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_CHATBOT2222 }} # Секрет с Publish Profile
package: .