|
| 1 | +# Advanced Setup: Deployment options |
| 2 | + |
| 3 | +Here you will learn how to use the deployment options available with the v2 endpoints for CI/CD. |
| 4 | + |
| 5 | +This provides control over the CI/CD deployment process within the isolated instance before your code is pushed to the Cloud environment. |
| 6 | + |
| 7 | +## Option: skipVersionCheck |
| 8 | + |
| 9 | +During deployment, the system automatically checks for downgrades of Cloud dependencies. This prevents accidental downgrades of packages that may have been automatically upgraded on Umbraco Cloud. |
| 10 | + |
| 11 | +Enabling **skipVersionCheck** will bypass that safeguard and allow deployments that include downgraded packages. |
| 12 | + |
| 13 | +{% hint style="info" %} |
| 14 | +This option increases risk and is not recommended for normal workflows. Only enable it when you understand the package differences and accept the potential consequences. |
| 15 | +{% endhint %} |
| 16 | + |
| 17 | +## Option: noBuildAndRestore |
| 18 | + |
| 19 | +The Umbraco CI/CD flow runs the deployment in an isolated instance and performs `dotnet restore` and `dotnet build` to catch obvious build issues before deploying to Cloud. Enabling **noBuildAndRestore** skips the restore and build steps in that isolated instance, which can shorten deployment time by a few minutes. |
| 20 | + |
| 21 | +Keep in mind the final Kudu deployment on the Cloud environment will still run **restore**, **build**, and **publish**; those steps cannot be skipped. |
| 22 | + |
| 23 | +## How to enable the options |
| 24 | + |
| 25 | +All pipeline scripts generally follow the same structure, but there are a few small details to be aware of. |
| 26 | + |
| 27 | +{% tabs %} |
| 28 | +{% tab title="Azure DevOps Bash" %} |
| 29 | +Locate the main entry pipeline file. It will usually be this one: `azure-release-pipeline.yaml`. |
| 30 | + |
| 31 | +```yml |
| 32 | + # Deploy to Umbraco Cloud |
| 33 | + # #### |
| 34 | + # you can edit the variables noBuildAndRestore and skipVersionCheck |
| 35 | + # use booleans but as strings |
| 36 | + - stage: CloudDeploymentStage |
| 37 | + displayName: Deploy To Cloud |
| 38 | + dependsOn: cloudPrepareArtifact |
| 39 | + condition: in(dependencies.cloudPrepareArtifact.result, 'Succeeded') |
| 40 | + variables: |
| 41 | + artifactId: $[ stageDependencies.cloudPrepareArtifact.PrepareAndUploadArtifact.outputs['uploadArtifact.artifactId'] ] |
| 42 | + jobs: |
| 43 | + - template: cloud-deployment.yml |
| 44 | + parameters: |
| 45 | + artifactId: $(artifactId) |
| 46 | + noBuildAndRestore: 'false' |
| 47 | + skipVersionCheck: 'false' |
| 48 | +``` |
| 49 | +
|
| 50 | +The fields: `noBuildAndRestore` and `skipVersionCheck` can be marked with a `true`. |
| 51 | + |
| 52 | + |
| 53 | +{% endtab %} |
| 54 | +{% tab title="Azure DevOps PowerShell" %} |
| 55 | +Locate the main entry pipeline file. It will usually be this one: `azure-release-pipeline.yaml`. |
| 56 | + |
| 57 | +```yml |
| 58 | + # Deploy to Umbraco Cloud |
| 59 | + # #### |
| 60 | + # you can edit the variables noBuildAndRestore and skipVersionCheck |
| 61 | + # use booleans |
| 62 | + - stage: CloudDeploymentStage |
| 63 | + displayName: Deploy To Cloud |
| 64 | + dependsOn: cloudPrepareArtifact |
| 65 | + condition: in(dependencies.cloudPrepareArtifact.result, 'Succeeded') |
| 66 | + variables: |
| 67 | + artifactId: $[ stageDependencies.cloudPrepareArtifact.PrepareAndUploadArtifact.outputs['uploadArtifact.artifactId'] ] |
| 68 | + jobs: |
| 69 | + - template: cloud-deployment.yml |
| 70 | + parameters: |
| 71 | + artifactId: $(artifactId) |
| 72 | + noBuildAndRestore: false |
| 73 | + skipVersionCheck: false |
| 74 | +
|
| 75 | +``` |
| 76 | + |
| 77 | +The fields: `noBuildAndRestore` and `skipVersionCheck` can be marked with a `true`. |
| 78 | + |
| 79 | + |
| 80 | +{% endtab %} |
| 81 | +{% tab title="GitHub Actions Bash" %} |
| 82 | +Locate the main entry pipeline file. It will usually be this one: `main.yml`. |
| 83 | + |
| 84 | +```yml |
| 85 | + # Deploy to Umbraco Cloud |
| 86 | + # #### |
| 87 | + # you can edit the variables noBuildAndRestore and skipVersionCheck |
| 88 | + # use booleans but as strings |
| 89 | + cloud-deployment: |
| 90 | + name: "Deploy to Cloud" |
| 91 | + needs: cloud-artifact |
| 92 | + uses: ./.github/workflows/cloud-deployment.yml |
| 93 | + with: |
| 94 | + artifactId: ${{ needs.cloud-artifact.outputs.artifactId }} |
| 95 | + targetEnvironmentAlias: ${{ vars.TARGET_ENVIRONMENT_ALIAS }} |
| 96 | + noBuildAndRestore: "false" |
| 97 | + skipVersionCheck: "false" |
| 98 | + secrets: |
| 99 | + projectId: ${{ secrets.PROJECT_ID }} |
| 100 | + umbracoCloudApiKey: ${{ secrets.UMBRACO_CLOUD_API_KEY }} |
| 101 | +``` |
| 102 | + |
| 103 | +The fields: `noBuildAndRestore` and `skipVersionCheck` can be marked with a `true`. |
| 104 | + |
| 105 | +{% endtab %} |
| 106 | +{% tab title="GitHub Actions PowerShell" %} |
| 107 | +Locate the main entry pipeline file. It will usually be this one: `main.yml`. |
| 108 | + |
| 109 | +```yml |
| 110 | + # Deploy to Umbraco Cloud |
| 111 | + # #### |
| 112 | + # you can edit the variables noBuildAndRestore and skipVersionCheck |
| 113 | + # use 0 for false and 1 for true |
| 114 | + cloud-deployment: |
| 115 | + name: "Deploy to Cloud" |
| 116 | + needs: cloud-artifact |
| 117 | + uses: ./.github/workflows/cloud-deployment.yml |
| 118 | + with: |
| 119 | + artifactId: ${{ needs.cloud-artifact.outputs.artifactId }} |
| 120 | + targetEnvironmentAlias: ${{ vars.TARGET_ENVIRONMENT_ALIAS }} |
| 121 | + noBuildAndRestore: 0 |
| 122 | + skipVersionCheck: 0 |
| 123 | + secrets: |
| 124 | + projectId: ${{ secrets.PROJECT_ID }} |
| 125 | + umbracoCloudApiKey: ${{ secrets.UMBRACO_CLOUD_API_KEY }} |
| 126 | +``` |
| 127 | + |
| 128 | +The fields: `noBuildAndRestore` and `skipVersionCheck` can be marked with a `1`. |
| 129 | + |
| 130 | +{% endtab %} |
| 131 | +{% endtabs %} |
0 commit comments