Bump postcss from 8.4.14 to 8.4.31 in /demo/src/Foundation #201
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
# This is a basic workflow to help you get started with Actions | |
name: CI | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
on: | |
push: | |
branches: | |
- develop | |
- release/** | |
- hotfix/** | |
- feature/** | |
pull_request: | |
branches: | |
- develop | |
- master | |
release: | |
types: | |
- created | |
env: | |
Configuration: Release | |
dotnetCoreVersion: 3.1.101 | |
pluginSlnPath: swedbank-pay-episerver-checkout.sln | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
build-plugin: | |
name: Build plugin packages | |
runs-on: windows-2019 | |
env: | |
ARTIFACT_STAGING_PATH: ${{ github.workspace }}/artifacts | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: '5.x' | |
- name: Fetch all history for all tags and branches | |
run: git fetch --prune --unshallow | |
- name: Use GitVersion | |
id: gitversion # step id used as reference for output values | |
uses: gittools/actions/gitversion/[email protected] | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ env.dotnetCoreVersion }} | |
- name: Install dependencies | |
run: dotnet restore ${{ env.pluginSlnPath }} | |
- name: Build plugin with dotnet build | |
run: dotnet build ${{ env.pluginSlnPath }} --configuration ${{ env.Configuration }} --no-restore | |
- name: Nuget pack | |
if: ${{ github.event_name != 'pull_request' }} | |
run: | | |
dotnet pack src/SwedbankPay.Episerver.Checkout/SwedbankPay.Episerver.Checkout.csproj -p:PackageVersion=${{ steps.gitversion.outputs.NUGETVERSIONV2 }} -p:Version=${{ steps.gitversion.outputs.NUGETVERSIONV2 }} --configuration=${{ env.Configuration }} --output=${{ env.ARTIFACT_STAGING_PATH }} | |
dotnet pack src/SwedbankPay.Episerver.Checkout.CommerceManager/SwedbankPay.Episerver.Checkout.CommerceManager.csproj -p:PackageVersion=${{ steps.gitversion.outputs.NUGETVERSIONV2 }} -p:Version=${{ steps.gitversion.outputs.NUGETVERSIONV2 }} --configuration=${{ env.Configuration }} --output=${{ env.ARTIFACT_STAGING_PATH }} | |
- name: Publish nuget packages artifacts | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
# Artifact name | |
name: packages | |
# A file, directory or wildcard pattern that describes what to upload | |
path: ${{ env.ARTIFACT_STAGING_PATH }}/*.nupkg | |
variables: | |
name: Set deploy variables | |
if: ${{ github.event_name != 'pull_request' }} | |
needs: [build-plugin] | |
runs-on: ubuntu-latest | |
outputs: | |
ENVIRONMENT: ${{ steps.setoutputvariables.outputs.ENVIRONMENT }} | |
AZURE_SITE_NAME: ${{ steps.setoutputvariables.outputs.AZURE_SITE_NAME }} | |
AZURE_CM_NAME: ${{ steps.setoutputvariables.outputs.AZURE_CM_NAME }} | |
SITE_URL: ${{ steps.setoutputvariables.outputs.SITE_URL }} | |
CM_URL: ${{ steps.setoutputvariables.outputs.CM_URL }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Dump GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- name: Set dev environment variables | |
uses: allenevans/[email protected] | |
if: ${{ startsWith(github.ref, 'refs/heads/develop') || github.base_ref == 'develop' || startsWith(github.ref, 'refs/heads/feature/')}} | |
with: | |
ENVIRONMENT: dev | |
AZURE_SITE_NAME: payexepiserver001dev | |
AZURE_CM_NAME: mgrpayexepiserver001dev | |
SITE_URL: https://payexepiserver001dev.azurewebsites.net/ | |
CM_URL: https://mgrpayexepiserver001dev.azurewebsites.net/ | |
- name: Set uat environment variables | |
uses: allenevans/[email protected] | |
if: ${{ startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/hotfix/') || contains(github.ref, '-beta')}} | |
with: | |
ENVIRONMENT: uat | |
AZURE_SITE_NAME: payexepiserver001uat | |
AZURE_CM_NAME: mgrpayexepiserver001uat | |
SITE_URL: https://payexepiserver001uat.azurewebsites.net/ | |
CM_URL: https://mgrpayexepiserver001uat.azurewebsites.net/ | |
- name: Set pro environment variables | |
uses: allenevans/[email protected] | |
if: ${{ startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'refs/tags/*-*') }} | |
with: | |
ENVIRONMENT: pro | |
AZURE_SITE_NAME: payexepiserver001pro | |
AZURE_CM_NAME: mgrpayexepiserver001pro | |
SITE_URL: https://payexepiserver001pro.azurewebsites.net/ | |
CM_URL: https://mgrpayexepiserver001pro.azurewebsites.net/ | |
- id: setoutputvariables | |
name: Set output variables | |
run: | | |
echo "::set-output name=ENVIRONMENT::${ENVIRONMENT}" | |
echo "::set-output name=AZURE_SITE_NAME::${AZURE_SITE_NAME}" | |
echo "::set-output name=AZURE_CM_NAME::${AZURE_CM_NAME}" | |
echo "::set-output name=SITE_URL::${SITE_URL}" | |
echo "::set-output name=CM_URL::${CM_URL}" | |
build-demo-site: | |
name: Build and deploy demo site | |
needs: [variables, build-plugin] | |
runs-on: windows-2019 | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: '5.x' | |
- name: Fetch all history for all tags and branches | |
run: git fetch --prune --unshallow | |
- name: Use GitVersion | |
id: gitversion # step id used as reference for output values | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
updateAssemblyInfo: true | |
updateAssemblyInfoFilename: ./demo/src/Foundation/Properties/AssemblyInfo.cs | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ env.dotnetCoreVersion }} | |
- name: setup-msbuild | |
uses: microsoft/setup-msbuild@v1 | |
- name: Setup NuGet.exe for use with actions | |
uses: NuGet/[email protected] | |
- name: Restore packages | |
run: nuget restore demo/Foundation.sln | |
- name: Install xdt tool | |
run: dotnet tool install --global dotnet-xdt --version 2.2.0 | |
- name: Transform site config files | |
working-directory: demo/src/Foundation | |
run: | | |
dotnet xdt --source Web.config --transform Web.${{ needs.variables.outputs.ENVIRONMENT }}.config --output Web.config | |
dotnet xdt --source connectionStrings.config --transform connectionStrings.${{ needs.variables.outputs.ENVIRONMENT }}.config --output connectionStrings.config | |
- name: Transform cm config files | |
working-directory: demo/src/Foundation.CommerceManager | |
run: | | |
dotnet xdt --source connectionStrings.config --transform connectionStrings.${{ needs.variables.outputs.ENVIRONMENT }}.config --output connectionStrings.config | |
dotnet xdt --source Web.config --transform Web.${{ needs.variables.outputs.ENVIRONMENT }}.config --output Web.config | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '14' | |
- name: Npm install | |
working-directory: demo/src/Foundation | |
run: npm install | |
- name: Build demo solution with MSBuild | |
run: msbuild demo/Foundation.sln /p:DeployOnBuild=true /p:PublishProfile=FolderProfile /p:Configuration=Release | |
- name: Deploy Dev Site to Azure | |
if: ${{ !startsWith(github.ref, 'refs/heads/feature/') && github.event_name != 'pull_request' && needs.variables.outputs.ENVIRONMENT == 'dev'}} | |
uses: Azure/[email protected] | |
with: | |
app-name: ${{ needs.variables.outputs.AZURE_SITE_NAME }} | |
package: 'demo/src/Foundation/swedbankpayartifacts/site' | |
publish-profile: ${{ secrets.AZURE_SITE_DEV_PUBLISH_PROFILE }} | |
- name: Deploy Dev Commerce Manager to Azure | |
if: ${{ !startsWith(github.ref, 'refs/heads/feature/') && github.event_name != 'pull_request' && needs.variables.outputs.ENVIRONMENT == 'dev'}} | |
uses: Azure/[email protected] | |
with: | |
app-name: ${{ needs.variables.outputs.AZURE_CM_NAME }} | |
package: 'demo/src/Foundation.CommerceManager/swedbankpayartifacts/cm' | |
publish-profile: ${{ secrets.AZURE_CM_DEV_PUBLISH_PROFILE }} | |
- name: Deploy Uat Site to Azure | |
if: ${{ github.event_name != 'pull_request' && needs.variables.outputs.ENVIRONMENT == 'uat'}} | |
uses: Azure/[email protected] | |
with: | |
app-name: ${{ needs.variables.outputs.AZURE_SITE_NAME }} | |
package: 'demo/src/Foundation/swedbankpayartifacts/site' | |
publish-profile: ${{ secrets.AZURE_SITE_UAT_PUBLISH_PROFILE }} | |
- name: Deploy Uat Commerce Manager to Azure | |
if: ${{ github.event_name != 'pull_request' && needs.variables.outputs.ENVIRONMENT == 'uat'}} | |
uses: Azure/[email protected] | |
with: | |
app-name: ${{ needs.variables.outputs.AZURE_CM_NAME }} | |
package: 'demo/src/Foundation.CommerceManager/swedbankpayartifacts/cm' | |
publish-profile: ${{ secrets.AZURE_CM_UAT_PUBLISH_PROFILE }} | |
- name: Deploy Pro Site to Azure | |
if: ${{ github.event_name != 'pull_request' && needs.variables.outputs.ENVIRONMENT == 'pro'}} | |
uses: Azure/[email protected] | |
with: | |
app-name: ${{ needs.variables.outputs.AZURE_SITE_NAME }} | |
package: 'demo/src/Foundation/swedbankpayartifacts/site' | |
publish-profile: ${{ secrets.AZURE_SITE_PRO_PUBLISH_PROFILE }} | |
- name: Deploy Pro Commerce Manager to Azure | |
if: ${{ github.event_name != 'pull_request' && needs.variables.outputs.ENVIRONMENT == 'pro'}} | |
uses: Azure/[email protected] | |
with: | |
app-name: ${{ needs.variables.outputs.AZURE_CM_NAME }} | |
package: 'demo/src/Foundation.CommerceManager/swedbankpayartifacts/cm' | |
publish-profile: ${{ secrets.AZURE_CM_PRO_PUBLISH_PROFILE }} | |
# - name: Run UI Tests | |
# if: ${{ needs.variables.outputs.ENVIRONMENT == 'uat'}} | |
# run: dotnet test --configuration ${{ env.Configuration }} demo/src/Foundation.SystemTests/Foundation.SystemTests.csproj | |
# env: | |
# Credentials:MerchantId: ${{ secrets.MERCHANT_ID }} | |
# Credentials:Secret: ${{ secrets.MERCHANT_SECRET }} | |
# FoundationCommerce: ${{ needs.variables.outputs.SITE_URL }} | |
# ManagerCommerce: ${{ needs.variables.outputs.CM_URL }} | |
deploy: | |
if: ${{ github.event_name == 'release' }} | |
name: Deploy to nuget | |
needs: [variables, build-plugin, build-demo-site] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download All artifacts | |
uses: actions/download-artifact@v3 | |
- name: Publish to nuget | |
run: dotnet nuget push 'packages/*.nupkg' --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate |