ci: More indentation fixes? #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Azure Static Web Apps CI/CD | ||
on: | ||
push: | ||
branches: | ||
- test/ffv2-test | ||
pull_request: | ||
types: [opened, synchronize, reopened, closed] | ||
branches: | ||
- test/ffv2-test | ||
jobs: | ||
- job: build_site | ||
displayName: 'Build website' | ||
dependsOn: upload_json | ||
pool: Large | ||
steps: | ||
- checkout: self | ||
submodules: false | ||
clean: true | ||
- task: DownloadPipelineArtifact@2 | ||
displayName: 'Copy api-extractor JSON to staging folder' | ||
inputs: | ||
source: current | ||
artifact: api-extractor-combined | ||
path: '$(Build.SourcesDirectory)/_api-extractor-temp/doc-models' | ||
- template: templates/include-use-node-version.yml | ||
- template: templates/include-install-pnpm.yml | ||
parameters: | ||
buildDirectory: $(Build.SourcesDirectory)/docs | ||
- task: Bash@3 | ||
displayName: Install dependencies | ||
inputs: | ||
targetType: 'inline' | ||
workingDirectory: $(Build.SourcesDirectory)/docs | ||
script: | | ||
pnpm i --frozen-lockfile | ||
- task: Bash@3 | ||
displayName: Download and extract previous version API | ||
inputs: | ||
targetType: 'inline' | ||
workingDirectory: $(Build.SourcesDirectory) | ||
script: | | ||
# Run helper script to read versions.json | ||
output=$(node docs/readVersionData.js) | ||
# Pipe script output and loop through each value in the array | ||
if [ -n "$output" ]; then | ||
echo "$output" | while IFS= read -r version; do | ||
version=$(echo "$version" | sed 's/"//g') | ||
echo "Version: $version" | ||
echo "creating api-extractor-temp-$version folder" | ||
mkdir -p $(Build.SourcesDirectory)/_api-extractor-temp-$version/doc-models | ||
az storage blob download -f latest-$version.tar.gz -c 'api-extractor-json' -n latest-$version.tar.gz --account-name $(STORAGE_ACCOUNT) --account-key $(STORAGE_KEY) --overwrite --verbose | ||
tar -xzf latest-$version.tar.gz -C _api-extractor-temp-$version/doc-models | ||
done | ||
fi | ||
- task: Npm@1 | ||
displayName: npm run build:multi-version | ||
inputs: | ||
command: 'custom' | ||
workingDir: $(Build.SourcesDirectory)/docs | ||
customCommand: 'run build:multi-version' | ||
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 | ||
displayName: 'Generate SBOM' | ||
inputs: | ||
BuildDropPath: $(Build.SourcesDirectory)/docs/public | ||
PackageName: 'fluidframework-docs' | ||
PackageVersion: '$(Build.BuildId)' | ||
- task: PublishPipelineArtifact@1 | ||
displayName: 'Publish site build artifact' | ||
inputs: | ||
targetPath: '$(Build.SourcesDirectory)/docs/public' | ||
artifactName: 'fluidframework-docs' | ||
publishLocation: 'pipeline' | ||
- build_and_deploy_job: | ||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | ||
runs-on: ubuntu-latest | ||
name: Build and Deploy Job | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
lfs: false | ||
- name: Build And Deploy | ||
id: builddeploy | ||
uses: Azure/static-web-apps-deploy@v1 | ||
with: | ||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_NICE_SEA_0903FC310 }} | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) | ||
action: "upload" | ||
###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### | ||
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig | ||
app_location: "/docs" # App source code path | ||
api_location: "" # Api source code path - optional | ||
output_location: "public" # Built app content directory - optional | ||
skip_app_build: true # site was built in previous stage | ||
###### End of Repository/Build Configurations ###### | ||
- close_pull_request_job: | ||
if: github.event_name == 'pull_request' && github.event.action == 'closed' | ||
runs-on: ubuntu-latest | ||
name: Close Pull Request Job | ||
steps: | ||
- name: Close Pull Request | ||
id: closepullrequest | ||
uses: Azure/static-web-apps-deploy@v1 | ||
with: | ||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_NICE_SEA_0903FC310 }} | ||
action: "close" |