다음을 통해 공유


AzureStaticWebApp@0 - Azure Static Web App v0 작업 배포

이 작업은 Azure Static 웹앱을 빌드하고 배포합니다.

통사론

# Deploy Azure Static Web App v0
# Build and deploy an Azure Static Web App.
- task: AzureStaticWebApp@0
  inputs:
    #workingDirectory: '$(System.DefaultWorkingDirectory)' # string. Alias: cwd | rootDirectory. Working directory. Default: $(System.DefaultWorkingDirectory).
    #app_location: # string. App location. 
    #app_build_command: # string. App build command. 
    #output_location: # string. Output location. 
    #api_location: # string. Api location. 
    #api_build_command: # string. Api build command. 
    #routes_location: # string. Routes location. 
    #config_file_location: # string. Config file location. 
    #skip_app_build: # boolean. Skip app build. 
    #skip_api_build: # boolean. Skip api build. 
    #is_static_export: # boolean. Set static export. 
    #verbose: # boolean. Verbose. 
    #build_timeout_in_minutes: # string. Build timeout in minutes. 
    #azure_static_web_apps_api_token: # string. Azure Static Web Apps api token. 
    #deployment_environment: # string. Deployment Environment. 
    #production_branch: # string. Production Branch. 
    #data_api_location: # string. Data api location.
# Deploy Azure Static Web App v0
# Build and deploy an Azure Static Web App.
- task: AzureStaticWebApp@0
  inputs:
    #workingDirectory: '$(System.DefaultWorkingDirectory)' # string. Alias: cwd | rootDirectory. Working directory. Default: $(System.DefaultWorkingDirectory).
    #app_location: # string. App location. 
    #app_build_command: # string. App build command. 
    #output_location: # string. Output location. 
    #api_location: # string. Api location. 
    #api_build_command: # string. Api build command. 
    #routes_location: # string. Routes location. 
    #config_file_location: # string. Config file location. 
    #skip_app_build: # boolean. Skip app build. 
    #skip_api_build: # boolean. Skip api build. 
    #is_static_export: # boolean. Set static export. 
    #verbose: # boolean. Verbose. 
    #build_timeout_in_minutes: # string. Build timeout in minutes. 
    #azure_static_web_apps_api_token: # string. Azure Static Web Apps api token. 
    #deployment_environment: # string. Deployment Environment. 
    #production_branch: # string. Production Branch.

입력

workingDirectory - 작업 디렉터리
입력 별칭: cwd | rootDirectory. string; 기본값: $(System.DefaultWorkingDirectory).

이 작업을 실행할 절대 작업 디렉터리를 지정합니다. 비워 두면 기본 작업 디렉터리가 사용됩니다.


앱 위치
string;

작업 디렉터리를 기준으로 하는 애플리케이션 소스 코드의 디렉터리 위치입니다. skip_app_build: true함께 사용하는 경우 이 값은 앱의 빌드 출력 위치입니다.


app_build_command - 앱 빌드 명령
string;

애플리케이션 소스 코드를 빌드할 때 Oryx를 실행하는 데 사용되는 사용자 지정 명령입니다.


output_location - 출력 위치
string;

빌드 후 컴파일된 애플리케이션 코드의 디렉터리 위치는 작업 디렉터리를 기준으로 완료됩니다. 자동 빌드를 바이패스할 때 빈 문자열('')을 설정하고 배포만 필요합니다.


api_location - API 위치
string;

작업 디렉터리를 기준으로 하는 Azure Functions 소스 코드의 디렉터리 위치입니다.


api_build_command - API 빌드 명령
string;

Azure Functions 소스 코드를 빌드할 때 Oryx를 실행하는 데 사용되는 사용자 지정 명령입니다.


경로 위치
string;

작업 디렉터리를 기준으로 routes.json 파일의 디렉터리 위치입니다.
참고: Routes.json 더 이상 사용되지 않습니다. staticwebapp.config.json사용합니다.


config_file_location - 구성 파일 위치
string;

작업 디렉터리를 기준으로 staticwebapp.config.json 파일의 디렉터리 위치입니다.


앱 빌드 건너뛰기
boolean;

앱 폴더에 대한 Oryx 빌드를 건너뜁니다.


api 빌드 건너뛰기
boolean;

API 폴더에 대한 Oryx 빌드를 건너뜁니다.


is_static_export - 정적 내보내기 설정
boolean;

true사용하는 경우처럼 애플리케이션이 정적 HTML로 내보내도록 구성된 경우 이 플래그를 next export 설정합니다.

이 플래그가 true 설정되면


자세한 정보 표시
boolean;

자세한 정보 로깅을 사용하도록 설정합니다.


build_timeout_in_minutes - 빌드 시간 제한(분)
string;

Oryx 앱 폴더 빌드의 시간 제한을 분 단위로 지정합니다.


Azure Static Web Apps api 토큰
string;

배포에 대한 API 토큰을 지정합니다.
참고: 환경 변수로 전달되는 경우 필요하지 않습니다.


deployment_environment - 배포 환경
string;

배포할 환경을 지정합니다. 프로덕션 환경에 대해 비워 둡니다. 이 입력은 프로덕션 분기보다 우선합니다.


production_branch - 프로덕션 분기
string;

프로덕션 분기를 지정합니다. 정의되고 배포 환경이 비어 있으면 다른 분기의 배포는 미리 보기 환경이 됩니다.


데이터 api 위치
string;

작업 디렉터리를 기준으로 하는 Data API 원본 파일의 디렉터리 위치입니다.


작업 제어 옵션

모든 작업에는 작업 입력 외에도 제어 옵션이 있습니다. 자세한 내용은 컨트롤 옵션 및 일반적인 작업 속성참조하세요.

출력 변수

이 작업은 다운스트림 단계, 작업 및 단계에서 사용할 수 있는 다음 출력 변수정의합니다.

AZURESTATICWEBAPP_STATIC_WEB_APP_URL
배포가 성공한 후 정적 웹앱의 URL을 .

발언

메모

이 작업은 Linux 에이전트에서만 실행됩니다.

예제


trigger:
  - main

pool:
  vmImage: ubuntu-latest

steps:
  - checkout: self
    submodules: true
  - task: AzureStaticWebApp@0
    inputs:
      app_location: '/build'
      api_location: 'api'
      output_location: '/output'
      azure_static_web_apps_api_token: $(deployment_token)

프런트 엔드 앱 빌드 건너뛰기 및 배포만 실행


trigger:
- main

pool:
  vmImage: ubuntu-latest

steps:
  - task: NodeTool@0
    inputs:
      versionSpec: '20.x'
    displayName: 'Install Node.js'

  - script: |
      npm ci
      npm run build
    displayName: 'dependencies install and distribution build'

- task: AzureStaticWebApp@0
  inputs:
    app_location : '/dist'
    output_location: '' # Leave this empty
    skip_app_build: true
    skip_api_build: true
    azure_static_web_apps_api_token: $(deployment_token)

요구 사항

요구 묘사
파이프라인 유형 YAML, 클래식 빌드, 클래식 릴리스
다음에서 실행 에이전트, DeploymentGroup
요구 없음
기능 이 작업은 작업의 후속 작업에 대한 요구 사항을 충족하지 않습니다.
명령 제한 어떤
settable 변수 어떤
에이전트 버전 1.95.0 이상
작업 범주 유틸리티