Static Web App Pipeline with Publish Artifact not Getting correct folder

Viewed 22

The following Pipeline is successful in creating an Artifact but when I download the Artifact it consists of files but not my React project build directory. A listing of the files are also below. The Goal is to create an Artifact of the React build dir so that it can be used later by another Pipeline to install the Web App in another resource.

name: Azure Static Web Apps CI/CD
#
# Trigger off of changes in master or another branch(s)
#
trigger:
  branches:
    include:
      - TestBranch

jobs:
- job: build_and_deploy_job
  displayName: Build and Deploy Test Web App
  condition: or(eq(variables['Build.Reason'], 'Manual'),or(eq(variables['Build.Reason'],'PullRequest'),eq(variables['Build.Reason'], 'IndividualCI')))
  pool:
    vmImage: ubuntu-latest
  variables:
  - group: <Name of your Static Web App Resource Group>
  steps:
  - checkout: self
    submodules: true
  - task: AzureStaticWebApp@0
    inputs:
      azure_static_web_apps_api_token: $(AZURE_STATIC_WEB_APPS_TOKEN_#####)
      # Details at https://aka.ms/swaworkflowconfig
      app_location: "/" # App source code path
      api_location: "" # Api source code path - optional
      output_location: "build" # Built app content directory - optional
      app_build_command: 'chmod 755 scripts/*.sh;./scripts/WebAppBuild.sh prod'
  - publish: build
    artifact: $(VARIABLE_IN_MY_PIPELINE)

Files that end up in the Artifact:

total 196
drwxrwxr-x 4 root root  4096 Jun 21 21:05 tools
-rwxrwxr-x 1 root root  1580 Jun 21 21:05 testStartupScriptGenerators.sh
-rwxrwxr-x 1 root root  2411 Jun 21 21:05 testRunTimeImages.sh
-rwxrwxr-x 1 root root  3605 Jun 21 21:05 testIntegration.sh
-rwxrwxr-x 1 root root  1786 Jun 21 21:05 testDetector.sh
-rwxrwxr-x 1 root root  1260 Jun 21 21:05 testBuildScriptGenerator.sh
-rwxrwxr-x 1 root root  2196 Jun 21 21:05 testBuildImages.sh
-rw-rw-r-- 1 root root   574 Jun 21 21:05 release.txt
-rwxrwxr-x 1 root root   740 Jun 21 21:05 generateConstants.sh
drwxrwxr-x 2 root root  4096 Jun 21 21:05 detector
-rwxrwxr-x 1 root root  4078 Jun 21 21:05 createSymlinksForDotnet.sh
-rw-rw-r-- 1 root root 15174 Jun 21 21:05 constants.yaml
-rwxrwxr-x 1 root root  2068 Jun 21 21:05 buildTestBuildImages.sh
-rwxrwxr-x 1 root root   650 Jun 21 21:05 buildSln.sh
-rwxrwxr-x 1 root root  6064 Jun 21 21:05 buildRunTimeImages.sh
-rwxrwxr-x 1 root root  5955 Jun 21 21:05 buildRunTimeImageBases.sh
-rwxrwxr-x 1 root root  5438 Jun 21 21:05 buildPythonSdkByVersion.sh
-rwxrwxr-x 1 root root  1239 Jun 21 21:05 buildPlatformBinaries.sh
-rwxrwxr-x 1 root root  1459 Jun 21 21:05 buildBuildpacksImages.sh
-rwxrwxr-x 1 root root 15961 Jun 21 21:05 buildBuildImages.sh
-rwxrwxr-x 1 root root  1809 Jun 21 21:05 buildBuildImageBases.sh
-rwxrwxr-x 1 root root  5514 Jun 21 21:05 __variables.sh
-rwxrwxr-x 1 root root   637 Jun 21 21:05 __sdkStorageConstants.sh
-rwxrwxr-x 1 root root   643 Jun 21 21:05 __rubyVersions.sh
-rwxrwxr-x 1 root root   296 Jun 21 21:05 __pythonVersions.sh
-rwxrwxr-x 1 root root  1856 Jun 21 21:05 __phpVersions.sh
-rwxrwxr-x 1 root root   416 Jun 21 21:05 __nodeVersions.sh
-rwxrwxr-x 1 root root   151 Jun 21 21:05 __javaVersions.sh
-rwxrwxr-x 1 root root   467 Jun 21 21:05 __hugoConstants.sh
-rwxrwxr-x 1 root root   417 Jun 21 21:05 __golangVersions.sh
-rwxrwxr-x 1 root root   102 Jun 21 21:05 __goVersions.sh
-rwxrwxr-x 1 root root  2107 Jun 21 21:05 __functions.sh
-rwxrwxr-x 1 root root   958 Jun 21 21:05 __extVarNames.sh
-rwxrwxr-x 1 root root   477 Jun 21 21:05 __dotNetCoreSdkVersions.sh
-rwxrwxr-x 1 root root  2553 Jun 21 21:05 __dotNetCoreRunTimeVersions.sh
-rwxrwxr-x 1 root root   438 Jun 21 21:05 __condaConstants.sh
-rw-rw-r-- 1 root root   596 Jun 21 21:05 TestAssembliesKey.snk
-rw-rw-r-- 1 root root  3378 Jun 21 21:05 Readme.md
-rw-rw-r-- 1 root root   160 Jun 21 21:05 FinalPublicKey.snk

I have tried using Pipeline environment variables but this task/job does not seem to expose them. publish: '$(Build.ArtifactStagingDirectory)' did not work.

0 Answers
Related