diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 00000000..35d13580 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,17 @@ +changelog: + categories: + - title: General Changes + labels: + - "*" + exclude: + authors: + - dependabot + - title: DevOps Changes + labels: + - devops + exclude: + labels: + - dependencies + - title: Dependencies + labels: + - dependencies diff --git a/.github/workflows/aks-deploy.yaml b/.github/workflows/aks-deploy.yaml index ac09dad7..862d1b3b 100644 --- a/.github/workflows/aks-deploy.yaml +++ b/.github/workflows/aks-deploy.yaml @@ -45,7 +45,7 @@ on: required: false type: string description: "Docker image tag." - default: "${{ github.sha }}" + default: "${{ github.event.release.tag_name || github.sha }}" maximumReplicas: required: false type: string @@ -189,28 +189,10 @@ jobs: Write-Output "adminIngressWhitelist=$adminIngressWhitelist" >> $env:GITHUB_ENV Write-Output "release=$release" >> $env:GITHUB_ENV - - name: Hash azureCredentials secret - uses: pplanel/hash-calculator-action@v1.3.1 - id: hash + - name: Login to Azure + uses: Andrews-McMeel-Universal/cache-azure-login@v1 with: - input: ${{ secrets.azureCredentials }} - method: MD5 - - - name: Cache Azure credentials - id: azure-cache - uses: actions/cache@v3 - with: - path: | - ~/.Azure - ${{ github.workspace }}/.Azure - key: ${{ runner.os }}-azurecreds-${{ steps.hash.outputs.digest }} - - - name: Login via Az module - if: steps.azure-cache.outputs.cache-hit != 'true' - uses: azure/login@v1 - with: - creds: "${{ secrets.azureCredentials }}" - enable-AzPSSession: true + azureCredentials: "${{ secrets.azureCredentials }}" - name: Generate .env file from Azure Key Vaults uses: Andrews-McMeel-Universal/get-envs@v1 @@ -220,7 +202,7 @@ jobs: environmentKeyVault: ${{ inputs.environmentKeyVault }} - name: Generate build args from Azure Key Vaults - uses: azure/powershell@v1.2.0 + uses: azure/powershell@v1 with: inlineScript: | if ("${{ inputs.environmentKeyVault }}") { @@ -248,7 +230,7 @@ jobs: azPSVersion: "latest" - name: Login to Azure Container Registry - uses: Azure/docker-login@v1.0.1 + uses: Azure/docker-login@v1 with: login-server: ${{ secrets.registryHostName }} username: ${{ secrets.registryUserName }} @@ -256,8 +238,12 @@ jobs: - name: Build & Push Docker Image run: | - docker build ${{ inputs.dockerFilePath }} ${{ env.buildArguments }} -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" - docker push "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" + docker build ${{ inputs.dockerFilePath }} ${{ env.buildArguments }} -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:latest" + if [[ "${{ inputs.dockerImageTag }}" == "${{ github.event.release.tag_name }}" ]]; then + MAJOR_RELEASE=$(echo "${{ github.event.release.tag_name }}" | cut -d "." -f 1) + docker tag "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${MAJOR_RELEASE}" + fi + docker push -a "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}" - name: Create values override file run: | @@ -318,7 +304,7 @@ jobs: - name: Bake Helm Templates id: bake - uses: azure/k8s-bake@v2.4 + uses: azure/k8s-bake@v2 with: renderEngine: "helm" helmChart: ${{ inputs.chartsPath }} @@ -369,7 +355,7 @@ jobs: name: bake-manifests-bundle path: ${{ needs.build.outputs.manifestsBundle }} - - name: Login via Az module + - name: Azure Login uses: azure/login@v1 with: creds: "${{ secrets.azureCredentials }}" @@ -393,7 +379,7 @@ jobs: - name: Apply configMap if it exists if: ${{ needs.build.outputs.configMap != null }} - uses: swdotcom/update-and-apply-kubernetes-configs@v1.2.0 + uses: swdotcom/update-and-apply-kubernetes-configs@v1 with: k8-config-file-paths: deployments/k8s/config-${{ inputs.environment }}.yaml @@ -419,7 +405,7 @@ jobs: } - name: Create K8s Image Pull Secret - uses: Azure/k8s-create-secret@v4.0 + uses: Azure/k8s-create-secret@v4 with: container-registry-url: ${{ secrets.registryHostName }} container-registry-username: ${{ secrets.registryUserName }} @@ -428,7 +414,7 @@ jobs: - name: Deploy to Azure Kubernetes Service timeout-minutes: ${{ inputs.deploymentTimeout }} - uses: Azure/k8s-deploy@v4.9 + uses: Azure/k8s-deploy@v4 with: namespace: ${{ inputs.environment }} manifests: ${{ needs.build.outputs.manifestsBundle }} @@ -444,31 +430,13 @@ jobs: runs-on: ubuntu-latest continue-on-error: false steps: - - name: Hash azureCredentials secret - uses: pplanel/hash-calculator-action@v1.3.1 - id: hash + - name: Login to Azure + uses: Andrews-McMeel-Universal/cache-azure-login@v1 with: - input: ${{ secrets.azureCredentials }} - method: MD5 - - - name: Cache Azure credentials - id: azure-cache - uses: actions/cache@v3 - with: - path: | - ~/.Azure - ${{ github.workspace }}/.Azure - key: ${{ runner.os }}-azurecreds-${{ steps.hash.outputs.digest }} - - - name: Login via Az module - if: steps.azure-cache.outputs.cache-hit != 'true' - uses: azure/login@v1 - with: - creds: "${{ secrets.azureCredentials }}" - enable-AzPSSession: true + azureCredentials: "${{ secrets.azureCredentials }}" - name: Create or Update Public DNS Record - uses: azure/powershell@v1.2.0 + uses: azure/powershell@v1 with: inlineScript: | $NewRecords = New-AzDnsRecordConfig -Cname "${{ secrets.azureClusterName }}-${{ inputs.environment }}-ingress.centralus.cloudapp.azure.com." diff --git a/.github/workflows/azfunction-deploy.yaml b/.github/workflows/azfunction-deploy.yaml index 528f6f98..831074c0 100644 --- a/.github/workflows/azfunction-deploy.yaml +++ b/.github/workflows/azfunction-deploy.yaml @@ -73,10 +73,10 @@ jobs: dotnet build --configuration Release --output ./output popd - - name: Login via Az module - uses: azure/login@v1 + - name: Login to Azure + uses: Andrews-McMeel-Universal/cache-azure-login@v1 with: - creds: "${{ secrets.AZURE_CREDENTIALS }}" + azureCredentials: "${{ secrets.AZURE_CREDENTIALS }}" - name: Whitelist Boley IPs uses: azure/CLI@v1 diff --git a/.github/workflows/b2c-build-and-deploy.yaml b/.github/workflows/b2c-build-and-deploy.yaml index a609a535..91034ffc 100644 --- a/.github/workflows/b2c-build-and-deploy.yaml +++ b/.github/workflows/b2c-build-and-deploy.yaml @@ -66,28 +66,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Hash azureCredentials secret - uses: pplanel/hash-calculator-action@v1.3.1 - id: hash + - name: Login to Azure + uses: Andrews-McMeel-Universal/cache-azure-login@v1 with: - input: ${{ secrets.azureCredentials }} - method: MD5 - - - name: Cache Azure credentials - id: azure-cache - uses: actions/cache@v3 - with: - path: | - ~/.Azure - ${{ github.workspace }}/.Azure - key: ${{ runner.os }}-azurecreds-${{ steps.hash.outputs.digest }} - - - name: Login via Az module - if: steps.azure-cache.outputs.cache-hit != 'true' - uses: azure/login@v1 - with: - creds: ${{ secrets.azureCredentials }} - enable-AzPSSession: true + azureCredentials: "${{ secrets.azureCredentials }}" - name: Generate .env file from Azure Key Vaults uses: Andrews-McMeel-Universal/get-envs@v1 diff --git a/.github/workflows/clear-azure-redis-cache.yaml b/.github/workflows/clear-azure-redis-cache.yaml new file mode 100644 index 00000000..723be869 --- /dev/null +++ b/.github/workflows/clear-azure-redis-cache.yaml @@ -0,0 +1,83 @@ +name: Clear Azure Redis Cache + +on: + workflow_call: + inputs: + environment: + required: true + type: string + description: "Environment to clear caches for." + resourceGroupName: + default: "AMU_DevOps_RG" + type: string + description: "Name of Resource Group that the Azure Redis Instance is in." + applicationCacheKey: + default: "*" + type: string + description: "Cache key for the application" + secrets: + azureCredentials: + required: true + +jobs: + clear-redis-cache: + name: Clear Azure Redis Cache + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Login to Azure + uses: Andrews-McMeel-Universal/cache-azure-login@v1 + with: + azureCredentials: "${{ secrets.azureCredentials }}" + + - name: Install Dependencies + uses: awalsh128/cache-apt-pkgs-action@v1 + with: + packages: redis-tools + version: 1.0 + + # Script is adapted from https://github.com/Andrews-McMeel-Universal/azure-content-management_tool/blob/main/Scripts/rundeck/Flush-RedisCache.ps1 + - name: Clear Redis Cache + uses: azure/powershell@v1 + with: + inlineScript: | + $CacheKey = "${{ inputs.applicationCacheKey }}" + $ResourceGroupName = "${{ inputs.resourceGroupName }}" + $Environment = "${{ inputs.environment }}" + + # Check to see if Azure Redis Cache PowerShell Module is installed + Install-Module -Name Az.RedisCache -Confirm:$false + + # Get list of Redis instances using tags + $Redis = Get-AzRedisCache -ResourceGroupName "$ResourceGroupName" | Where-Object { $_.Tag.Values -eq "$Environment" } + + # Loop through Redis instances + $Redis | ForEach-Object { + $RedisHostname = $_.HostName + $RedisPort = $_.Port + $RedisName = $_.Name + $RedisKey = (Get-AzRedisCacheKey -Name $RedisName -ResourceGroupName $ResourceGroupName).PrimaryKey + + Write-Host "Authenticating to $RedisHostname..." -ForegroundColor DarkGray + $RedisCommands = "AUTH $RedisKey + SELECT 0 + EVAL 'return redis.call(\'del\', unpack(redis.call(\'keys\', ARGV[1])))' 0 $CacheKey" + Write-Host "Clearing cache key: $CacheKey" -ForegroundColor DarkGray + $RedisResult = $RedisCommands | redis-cli -h $RedisHostname -p $RedisPort + + # Check if output from cache clearing command has correct status message + if ($RedisResult -match '^\d+$') { + Write-Host "Successfully flushed cache for $RedisHostname" -ForegroundColor Green + } + elseif ($RedisResult -match 'Wrong number of args calling Redis command From Lua script') { + Write-Host "Cache key $CacheKey missing in $RedisHostname" -ForegroundColor Yellow + } + else { + Write-Host "Cache key $CacheKey status unknown in $RedisHostname" -ForegroundColor Red + Write-Host "Full output: $RedisResult" + } + } + azPSVersion: "latest" + diff --git a/.github/workflows/dependabot-automations.yaml b/.github/workflows/dependabot-automations.yaml index a61b98c2..48a545f1 100644 --- a/.github/workflows/dependabot-automations.yaml +++ b/.github/workflows/dependabot-automations.yaml @@ -14,29 +14,27 @@ on: jobs: dependabot-automations: - name: Automatically Update Dependencies + name: Dependabot Automations runs-on: ubuntu-latest - # Checking the actor will prevent your Action run failing on non-Dependabot - # PRs but also ensures that it only does work for Dependabot PRs. - if: ${{ inputs.autoApprove || inputs.autoMerge && github.actor == 'dependabot[bot]' }} + if: ${{ inputs.autoApprove || inputs.autoMerge }} steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 - # This second step will fail if there's no metadata and so the approval - # will not occur. - - name: Dependabot metadata + # The approval step will fail if there's no metadata. + - name: Retrieve dependabot metadata id: dependabot-metadata - uses: dependabot/fetch-metadata@v1.3.1 + uses: dependabot/fetch-metadata@v1 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - - name: Auto Approve Dependabot PRs - uses: hmarr/auto-approve-action@v2.0.0 - if: ${{ inputs.autoApprove && github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' }} + - name: Approve PR + uses: hmarr/auto-approve-action@v3.2.1 + if: ${{ inputs.autoApprove }} with: github-token: "${{ secrets.GITHUB_TOKEN }}" - - name: Enable auto-merge for Dependabot PRs + - name: Enable auto-merge if: ${{ inputs.autoMerge && steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }} run: gh pr merge --auto --squash "$PR_URL" env: diff --git a/.github/workflows/dotnet-ci.yaml b/.github/workflows/dotnet-ci.yaml index 7cbd0c9e..b5c997b5 100644 --- a/.github/workflows/dotnet-ci.yaml +++ b/.github/workflows/dotnet-ci.yaml @@ -28,6 +28,11 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Login to Azure + uses: Andrews-McMeel-Universal/cache-azure-login@v1 + with: + azureCredentials: "${{ secrets.AZURE_CREDENTIALS }}" + - name: Use .env cache action uses: Andrews-McMeel-Universal/get-envs@v1 with: diff --git a/.github/workflows/mega-lint.yaml b/.github/workflows/mega-lint.yaml index d61493dc..c1ca0940 100644 --- a/.github/workflows/mega-lint.yaml +++ b/.github/workflows/mega-lint.yaml @@ -60,7 +60,7 @@ jobs: # Run the MegaLinter Github Action - name: MegaLinter id: ml - uses: oxsecurity/megalinter/flavors/cupcake@v6.20.1 + uses: oxsecurity/megalinter/flavors/cupcake@v7 env: VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'workflow_dispatch' }} GITHUB_TOKEN: ${{ secrets.PAT_ACTION_CI }} @@ -115,7 +115,7 @@ jobs: # Run the MegaLinter Github Action - name: MegaLinter id: ml - uses: oxsecurity/megalinter/flavors/dotnet@v6.20.1 + uses: oxsecurity/megalinter/flavors/dotnet@v7 env: VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'workflow_dispatch' }} GITHUB_TOKEN: ${{ secrets.PAT_ACTION_CI }} diff --git a/.github/workflows/next-ci.yaml b/.github/workflows/next-ci.yaml index 4ae47143..1e2f3d29 100644 --- a/.github/workflows/next-ci.yaml +++ b/.github/workflows/next-ci.yaml @@ -40,6 +40,11 @@ jobs: commit_user_email: amu_deploy@amuniversal.com commit_message: "[Formatter] Apply prettier changes" + - name: Login to Azure + uses: Andrews-McMeel-Universal/cache-azure-login@v1 + with: + azureCredentials: "${{ secrets.AZURE_CREDENTIALS }}" + - name: Use .env cache action uses: Andrews-McMeel-Universal/get-envs@v1 with: @@ -61,6 +66,11 @@ jobs: - name: Use cache-next-install action uses: Andrews-McMeel-Universal/cache-next-install@v1 + - name: Login to Azure + uses: Andrews-McMeel-Universal/cache-azure-login@v1 + with: + azureCredentials: "${{ secrets.AZURE_CREDENTIALS }}" + - name: Use .env cache action uses: Andrews-McMeel-Universal/get-envs@v1 with: @@ -88,6 +98,11 @@ jobs: - name: Install Playwright Browsers run: yarn pretest:integration:ci + - name: Login to Azure + uses: Andrews-McMeel-Universal/cache-azure-login@v1 + with: + azureCredentials: "${{ secrets.AZURE_CREDENTIALS }}" + - name: Use .env cache action uses: Andrews-McMeel-Universal/get-envs@v1 with: @@ -117,6 +132,11 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Login to Azure + uses: Andrews-McMeel-Universal/cache-azure-login@v1 + with: + azureCredentials: "${{ secrets.AZURE_CREDENTIALS }}" + - name: Use .env cache action uses: Andrews-McMeel-Universal/get-envs@v1 with: diff --git a/.github/workflows/purge-cdn.yaml b/.github/workflows/purge-cdn.yaml index 057df5d5..28939947 100644 --- a/.github/workflows/purge-cdn.yaml +++ b/.github/workflows/purge-cdn.yaml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check inputs - uses: azure/powershell@v1.2.0 + uses: azure/powershell@v1 with: azPSVersion: "latest" inlineScript: | @@ -38,31 +38,13 @@ jobs: exit 1 } - - name: Hash azureCredentials secret - uses: pplanel/hash-calculator-action@v1.3.1 - id: hash + - name: Login to Azure + uses: Andrews-McMeel-Universal/cache-azure-login@v1 with: - input: ${{ secrets.azureCredentials }} - method: MD5 - - - name: Cache Azure credentials - id: azure-cache - uses: actions/cache@v3 - with: - path: | - ~/.Azure - ${{ github.workspace }}/.Azure - key: ${{ runner.os }}-azurecreds-${{ steps.hash.outputs.digest }} - - - name: Login via Az module - if: steps.azure-cache.outputs.cache-hit != 'true' - uses: azure/login@v1 - with: - creds: ${{ secrets.azureCredentials }} - enable-AzPSSession: true + azureCredentials: "${{ secrets.azureCredentials }}" - name: Purge CDN cache - uses: azure/powershell@v1.2.0 + uses: azure/powershell@v1 with: azPSVersion: "latest" inlineScript: | diff --git a/.github/workflows/ruby-ci.yaml b/.github/workflows/ruby-ci.yaml index 30f207bf..4c949041 100644 --- a/.github/workflows/ruby-ci.yaml +++ b/.github/workflows/ruby-ci.yaml @@ -37,6 +37,11 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Login to Azure + uses: Andrews-McMeel-Universal/cache-azure-login@v1 + with: + azureCredentials: "${{ secrets.AZURE_CREDENTIALS }}" + - name: Use .env cache action uses: Andrews-McMeel-Universal/get-envs@v1 with: diff --git a/.github/workflows/template-sync.yml b/.github/workflows/template-sync.yml index 600fefae..9797fda8 100644 --- a/.github/workflows/template-sync.yml +++ b/.github/workflows/template-sync.yml @@ -21,7 +21,7 @@ jobs: token: ${{ secrets.PAT_ACTION_CI }} - name: actions-template-sync - uses: AndreasAugustin/actions-template-sync@v0.8.0 + uses: AndreasAugustin/actions-template-sync@v1.1.1 with: github_token: ${{ secrets.PAT_ACTION_CI }} source_repo_path: Andrews-McMeel-Universal/.github @@ -30,6 +30,7 @@ jobs: pr_commit_msg: 🔄 Synchronize with @Andrews-McMeel-Universal/.github pr_title: 🔄 Sync with @Andrews-McMeel-Universal/.github pr_branch_name_prefix: sync/dotgithub/ + pr_reviewers: Andrews-McMeel-Universal/devops-engineers is_dry_run: ${{ inputs.isdryrun || 'false' }} git_user_name: amutechtest git_user_email: amu_deploy@amuniversal.com diff --git a/.github/workflows/ui-ci.yaml b/.github/workflows/ui-ci.yaml new file mode 100644 index 00000000..fb10bd55 --- /dev/null +++ b/.github/workflows/ui-ci.yaml @@ -0,0 +1,164 @@ +name: Next.js Application CI + +on: + workflow_call: + inputs: + environment: + required: true + type: string + secrets: + AZURE_CREDENTIALS: + required: true + PAT_ACTION_CI: + required: true + +jobs: + build: + name: Build App + if: ${{ github.actor != 'dependabot[bot]' }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + token: ${{ secrets.PAT_ACTION_CI }} + fetch-depth: 0 + + - name: Use cache-yarn-install action + uses: Andrews-McMeel-Universal/cache-yarn-install@v1 + + - name: Lint javascript + run: yarn lint:js + + - name: Lint scss + run: yarn lint:styles + + - name: Push Linting Fixes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_user_name: amutechtest + commit_user_email: amu_deploy@amuniversal.com + commit_message: "[Formatter] Apply prettier changes" + + - name: Login to Azure + uses: Andrews-McMeel-Universal/cache-azure-login@v1 + with: + azureCredentials: "${{ secrets.AZURE_CREDENTIALS }}" + + - name: Use .env cache action + uses: Andrews-McMeel-Universal/get-envs@v1 + with: + azurecredentials: ${{ secrets.AZURE_CREDENTIALS }} + environment: ${{ inputs.environment }} + + - name: Use cache-next-build action + uses: Andrews-McMeel-Universal/cache-next-build@v1 + + unit-tests: + name: Unit Tests + needs: [build] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Use cache-yarn-install action + uses: Andrews-McMeel-Universal/cache-yarn-install@v1 + + - name: Login to Azure + uses: Andrews-McMeel-Universal/cache-azure-login@v1 + with: + azureCredentials: "${{ secrets.AZURE_CREDENTIALS }}" + + - name: Use .env cache action + uses: Andrews-McMeel-Universal/get-envs@v1 + with: + azurecredentials: ${{ secrets.AZURE_CREDENTIALS }} + environment: ${{ inputs.environment }} + + - name: Use cache-next-build action + uses: Andrews-McMeel-Universal/cache-next-build@v1 + + - name: Run Jest tests + run: yarn test:unit:ci + + integration-tests: + name: Integration Tests + needs: [build] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Use cache-yarn-install action + uses: Andrews-McMeel-Universal/cache-yarn-install@v1 + + - name: Install Playwright Browsers + run: yarn pretest:integration:ci + + - name: Login to Azure + uses: Andrews-McMeel-Universal/cache-azure-login@v1 + with: + azureCredentials: "${{ secrets.AZURE_CREDENTIALS }}" + + - name: Use .env cache action + uses: Andrews-McMeel-Universal/get-envs@v1 + with: + azurecredentials: ${{ secrets.AZURE_CREDENTIALS }} + environment: ${{ inputs.environment }} + + - name: Use cache-next-build action + uses: Andrews-McMeel-Universal/cache-next-build@v1 + + - name: Run Playwright tests + run: yarn test:integration:ci + + - uses: actions/upload-artifact@v3 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 + + # Required status check + # Checks gzipped page sizes and application links + check-app: + name: Check Links and Size Limit + runs-on: ubuntu-latest + needs: [build] + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Login to Azure + uses: Andrews-McMeel-Universal/cache-azure-login@v1 + with: + azureCredentials: "${{ secrets.AZURE_CREDENTIALS }}" + + - name: Use .env cache action + uses: Andrews-McMeel-Universal/get-envs@v1 + with: + azurecredentials: ${{ secrets.AZURE_CREDENTIALS }} + environment: ${{ inputs.environment }} + + - name: Use cache-yarn-install action + uses: Andrews-McMeel-Universal/cache-yarn-install@v1 + + - name: Use cache-next-build action + uses: Andrews-McMeel-Universal/cache-next-build@v1 + + - name: Run Broken Link Checker + id: link-checker-report + continue-on-error: true + run: yarn test:links + + - name: Link Checker Results + if: ${{ failure() }} + run: echo "::warning ${{steps.link-checker-report.outputs.result}}" + + - uses: andresz1/size-limit-action@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + # The size-limit-action tries to run a + # redundant yarn build + skip_step: build diff --git a/.github/workflows/update-addns.yaml b/.github/workflows/update-addns.yaml index 3a2c136e..26a08d99 100644 --- a/.github/workflows/update-addns.yaml +++ b/.github/workflows/update-addns.yaml @@ -38,7 +38,7 @@ jobs: steps: - name: Retrieve Application information id: getappinfo - uses: azure/powershell@v1.2.0 + uses: azure/powershell@v1 with: azPSVersion: "latest" inlineScript: | @@ -81,7 +81,7 @@ jobs: echo "aksIngress=$aksIngress" >> $env:GITHUB_ENV - name: Update Internal Boley DNS - uses: azure/powershell@v1.2.0 + uses: azure/powershell@v1 with: azPSVersion: "latest" inlineScript: | diff --git a/.github/workflows/update-azureapimanagement.yaml b/.github/workflows/update-azureapimanagement.yaml index 0cf2461c..97bc35fa 100644 --- a/.github/workflows/update-azureapimanagement.yaml +++ b/.github/workflows/update-azureapimanagement.yaml @@ -73,34 +73,14 @@ jobs: azurePassword: ${{ secrets.azurePassword }} azureSubscription: ${{ secrets.azureSubscription }} steps: - - name: Hash azureCredentials secret - if: ${{ env.azureCredentials }} - uses: pplanel/hash-calculator-action@v1.3.1 - id: hash + - name: Login to Azure + uses: Andrews-McMeel-Universal/cache-azure-login@v1 with: - input: ${{ secrets.azureCredentials }} - method: MD5 - - - name: Cache Azure credentials - if: ${{ env.azureCredentials }} - id: azure-cache - uses: actions/cache@v3 - with: - path: | - ~/.Azure - ${{ github.workspace }}/.Azure - key: ${{ runner.os }}-azurecreds-${{ steps.hash.outputs.digest }} - - - name: Login via Az module - if: ${{ steps.azure-cache.outputs.cache-hit != 'true' && env.azureCredentials }} - uses: azure/login@v1 - with: - creds: ${{ secrets.azureCredentials }} - enable-AzPSSession: true + azureCredentials: "${{ secrets.azureCredentials }}" - name: Login via PowerShell if: ${{ inputs.azureUser && env.azurePassword && env.azureSubscription }} - uses: azure/powershell@v1.2.0 + uses: azure/powershell@v1 with: azPSVersion: "latest" inlineScript: | @@ -114,7 +94,7 @@ jobs: - name: Retrieve Application information id: getappinfo - uses: azure/powershell@v1.2.0 + uses: azure/powershell@v1 with: azPSVersion: "latest" inlineScript: | @@ -155,7 +135,7 @@ jobs: echo "aksIngress=$aksIngress" >> $env:GITHUB_ENV - name: Update Azure API Management - uses: azure/powershell@v1.2.0 + uses: azure/powershell@v1 with: azPSVersion: "latest" inlineScript: | diff --git a/.github/workflows/update-game-config.yaml b/.github/workflows/update-game-config.yaml index ef462a57..05b2f6bd 100644 --- a/.github/workflows/update-game-config.yaml +++ b/.github/workflows/update-game-config.yaml @@ -19,28 +19,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Hash AZURE_CREDENTIALS secret - uses: pplanel/hash-calculator-action@v1.3.1 - id: hash + - name: Login to Azure + uses: Andrews-McMeel-Universal/cache-azure-login@v1 with: - input: ${{ secrets.AZURE_CREDENTIALS }} - method: MD5 - - - name: Cache Azure credentials - id: azure-cache - uses: actions/cache@v3 - with: - path: | - ~/.Azure - ${{ github.workspace }}/.Azure - key: ${{ runner.os }}-azurecreds-${{ steps.hash.outputs.digest }} - - - name: Login via Az module - if: steps.azure-cache.outputs.cache-hit != 'true' - uses: azure/login@v1 - with: - creds: "${{ secrets.AZURE_CREDENTIALS }}" - enable-AzPSSession: true + azureCredentials: "${{ secrets.AZURE_CREDENTIALS }}" - name: Generate .env file from Azure Key Vaults uses: Andrews-McMeel-Universal/get-envs@v1 diff --git a/.github/workflows/wpe-deploy.yaml b/.github/workflows/wpe-deploy.yaml index 6abcea72..2178ae71 100644 --- a/.github/workflows/wpe-deploy.yaml +++ b/.github/workflows/wpe-deploy.yaml @@ -36,7 +36,7 @@ jobs: uses: actions/checkout@v2 - name: Deploy to WP Engine - uses: wpengine/github-action-wpe-site-deploy@v3.2.2 + uses: wpengine/github-action-wpe-site-deploy@v3 with: # Deploy vars WPE_SSHG_KEY_PRIVATE: ${{ secrets.WPENGINE_ED25514 }} diff --git a/.gitignore b/.gitignore index a5ad2105..4f6097f5 100644 --- a/.gitignore +++ b/.gitignore @@ -255,6 +255,8 @@ megalinter-reports/* jscpd-report.json # Automated Testing +/coverage/integration +/test-results/ /playwright/storage-states/ /playwright/.cache/ /playwright-report/ @@ -754,3 +756,7 @@ Secrets.json ./history/ *.history .setup_done + +# Azure B2C +/**/src/custom-policies/B2C_1A_*_*_SIGNINSIGNOUT_*.xml +/custom-policies/**/B2C_1A_*_*_SIGNINSIGNOUT_*.xml diff --git a/.prettierignore b/.prettierignore index 13ce0ee2..cd1b88ba 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,8 +1,7 @@ # General .cache/ .git/ -storybook-static -src/helpers/utilities/tokens/_design_tokens.js + # GitHub Actions Workflows .github/dependabot.yml @@ -19,8 +18,13 @@ docker-compose.yml # Node.js .next build/ +coverage/ +playwright-report/ +test-results/ **.js.map **.bundle.js +storybook-static +src/helpers/utilities/tokens/_design_tokens.js # WordPress wp-content/