set force-overwrite to false (#599) #276
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
# Copyright (c) Microsoft Corporation. | |
# Licensed under the MIT License. | |
# Actions workflow for merges to main | |
name: paportal-rolling-instance-actions | |
on: | |
workflow_dispatch: # allow for manual workflow triggering as needed | |
inputs: | |
runPAPortalTests: | |
description: 'Run paportal commands by installing portal packages in fresh environment' | |
required: false | |
default: 'yes' | |
push: | |
branches: [ main ] | |
jobs: | |
instance-actions: | |
runs-on: ${{ matrix.os }} | |
outputs: | |
environment-url: ${{ steps.create-paportal-environment.outputs.environment-url }} | |
strategy: | |
matrix: | |
os: [windows-latest] | |
fail-fast: false | |
env: | |
RUNNER_DEBUG: 1 | |
WF_USERNAME: [email protected] | |
WF_APPID: ddb0fc45-d55c-4fd6-af4a-152359bb4ebd | |
WF_TENANT_ID: 3041a058-5110-495a-a575-b2a5571d9eac | |
PORTAL_WORKING_DIRECTORY: ./paportal-download | |
PORTAL_MANIFEST_FILE_PATH: ./starter-portal/.portalconfig/*-manifest.yml | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
registry-url: https://npm.pkg.github.com | |
- name: Install NPM packages | |
run: | | |
npm config set //npm.pkg.github.com/:_authToken=${{ secrets.GPR_ACCESS_TOKEN }} | |
npm ci | |
env: | |
AZ_DevOps_Read_PAT: ${{ secrets.AZ_DevOps_Read_PAT }} | |
- name: Download CDSStarterPortal package from portal authenticated feed | |
run: gulp fetchPortalPackage --feedPAT ${{ secrets.OneCRM_DevOps_Read_PAT }} | |
- name: Install PAC | |
uses: ./actions-install | |
id: actions-install | |
- name: Create a PA Portal test env | |
uses: ./create-environment | |
id: create-paportal-environment | |
env: | |
PP_SRC_ENV_NAME: ci-actions-paportal | |
with: | |
app-id: ${{ env.WF_APPID }} | |
client-secret: ${{ secrets.CLIENT_SECRET_PPDEVTOOLS }} | |
tenant-id: ${{ env.WF_TENANT_ID }} | |
name: ${{ env.PP_SRC_ENV_NAME }} | |
type: Sandbox | |
region: unitedstates | |
domain: ${{ env.PP_SRC_ENV_NAME }} | |
- name: Deploy paportal-package action to create a test Portal | |
if: matrix.os == 'windows-latest' | |
uses: ./deploy-package | |
with: | |
environment-url: ${{ steps.create-paportal-environment.outputs.environment-url }} | |
user-name: ${{ env.WF_USERNAME }} | |
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }} | |
tenant-id: ${{ env.WF_TENANT_ID }} | |
package: 'out\portal_package\Adxstudio.CDSStarterPortal.dll' | |
- name: Test paportal-download action with username/password | |
uses: ./download-paportal | |
with: | |
environment-url: ${{ steps.create-paportal-environment.outputs.environment-url }} | |
user-name: ${{ env.WF_USERNAME }} | |
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }} | |
website-id: f46b70cc-580b-4f1a-87c3-41deb48eb90d | |
download-path: ./paportal-download | |
- name: Delete portal manifest before uploading | |
working-directory: ${{ env.PORTAL_WORKING_DIRECTORY }} | |
run: rm ${{ env.PORTAL_MANIFEST_FILE_PATH }} | |
- name: Test paportal-upload action with username/password | |
uses: ./upload-paportal | |
with: | |
environment-url: ${{ steps.create-paportal-environment.outputs.environment-url }} | |
user-name: ${{ env.WF_USERNAME }} | |
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }} | |
upload-path: ./paportal-download/starter-portal | |
- name: Upload pac CLI logs | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pac-cli-log ${{ matrix.os }} | |
path: ./dist/pac*/tools/logs/pac-log.txt | |
linux-instance-actions: | |
needs: instance-actions | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
fail-fast: false | |
env: | |
RUNNER_DEBUG: 1 | |
WF_USERNAME: [email protected] | |
WF_APPID: ddb0fc45-d55c-4fd6-af4a-152359bb4ebd | |
WF_TENANT_ID: 3041a058-5110-495a-a575-b2a5571d9eac | |
PORTAL_WORKING_DIRECTORY: ./paportal-download | |
PORTAL_MANIFEST_FILE_PATH: ./starter-portal/.portalconfig/*-manifest.yml | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Install PAC | |
uses: ./actions-install | |
id: actions-install | |
- name: Test paportal-download action with username/password | |
uses: ./download-paportal | |
with: | |
environment-url: ${{ needs.instance-actions.outputs.environment-url }} | |
user-name: ${{ env.WF_USERNAME }} | |
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }} | |
website-id: f46b70cc-580b-4f1a-87c3-41deb48eb90d | |
download-path: ./paportal-download | |
- name: Delete portal manifest before uploading | |
working-directory: ${{ env.PORTAL_WORKING_DIRECTORY }} | |
run: rm ${{ env.PORTAL_MANIFEST_FILE_PATH }} | |
- name: Test paportal-upload action with username/password | |
uses: ./upload-paportal | |
with: | |
environment-url: ${{ needs.instance-actions.outputs.environment-url }} | |
user-name: ${{ env.WF_USERNAME }} | |
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }} | |
upload-path: ./paportal-download/starter-portal | |
- name: Delete PA Portal test environment | |
if: always() # Clean up created environments even on failed run | |
uses: ./delete-environment | |
with: | |
environment-url: ${{ needs.instance-actions.outputs.environment-url }} | |
user-name: ${{ env.WF_USERNAME }} | |
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }} | |
- name: Upload pac CLI logs | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pac-cli-log ${{ matrix.os }} | |
path: ./dist/pac*/tools/logs/pac-log.txt |