You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Setup.md
+19-10Lines changed: 19 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ So you now have a working local site running the latest codebase, with no sensit
55
55
56
56
## Getting Changes Back to Cloud
57
57
58
-
We're using a GitHub Action to do this.
58
+
We're using a GitHub Action that uses the V2 Umbraco Cloud API endpoints.
59
59
60
60
In your GitHub repository go to Settings > Security > Secrets and Variables > Actions. There are two tabs, one for Secrets and one for Variables.
61
61
@@ -69,27 +69,36 @@ On the Secrets tab, create the following Repository Secrets:
69
69
70
70
Now do the following updates to your repository:
71
71
72
-
1. Copy the Cloud API v1 powershell scripts from [here](.github/powershell/APIv1) into the same folder location in your repository (.github\powershell\APIv1)
72
+
1. Copy the Cloud API v1 powershell scripts from [here](.github/powershell/APIv2) into the same folder location in your repo (.github\powershell\APIv2)
73
73
74
-
1. Copy [`main.yml`](.github/workflows/main.yml) and [`package-and-deploy.yml`](.github/workflows/package-and-deploy.yml) into the same folder location in your repository (.github\workflows)
74
+
1. Copy all the .yml files from [here](.github/workflows) into the same folder location in your repo (.github\workflows)
75
75
76
-
1. Update your `main.yml` file and set the `pathToWebsite` and ` csProjFile` parameters to what your project needs
76
+
1. Update the `cloud-artifact` job in `main-v2.yml`:
77
+
78
+
- Set the `pathToWebsite` parameter
79
+
- Set the `csProjFile` parameter
80
+
- Set the `pathToFrontendClient` parameter (see ** Note below)
81
+
82
+
1. Update the `cloud-deployment` job in `main-v2.yml`:
83
+
84
+
- Set the `targetEnvironmentAlias` to the left-most main environment alias (check this in the Cloud Portal > Configuration > Advanced > Umbraco CI/CD Flow > CI/CD Environment Targets). Of course you may prefer to switch to use a Repository variable here.
77
85
78
86
1. In the root of your repository add the `cloud.zipignore` file that you can copy from [here](cloud.zipignore)
79
87
80
88
1. Copy your `.gitignore` file in the root of your repository and rename the copy to be `cloud.gitignore`
81
89
82
-
1.Then edit`cloud.gitignore` and remove the “CUSTOM rules” section that you added earlier
90
+
1.Edit`cloud.gitignore` and remove the “CUSTOM rules” section that you added earlier
83
91
84
-
Now you have a GitHub Action that will push to Cloud whenever the `main` branch is updated, or when it’s manually triggered (via the GitHub website Actions tab). If you’d prefer to only trigger a deployment manually, at least to start with, update the `on` section at the top of `main.yml`.
92
+
> [!NOTE]
93
+
> ** If you do NOT have a separate project which needs a npm build task then delete the `pathToFrontendClient` line, and update `cloud-artifact.yml` and delete the `Setup Node.js` and `Build frontend assets` steps.
85
94
86
-
You will probably now want to create a new branch called `develop` and set this as your default branch. But your branching strategy is up to you, just make sure that you understand when your GitHub action is going to run!
95
+
Now you have a GitHub Action that will push to Cloud whenever the `main` branchis updated, or when it’s manually triggered (via the GitHub website Actions tab).
87
96
88
-
We’re [working on](issues/1) switching to the Cloud version 2 API endpoints, as then you would be able to specify which target environment you want to deploy to (amongst other reasons).
97
+
You will probably now want to create a new branch called `develop` and set this as your default branch. But your branching strategy is up to you, just make sure that you understand when your GitHub action is going to run!
89
98
90
-
If you have more than one environment then the version 1 API endpoints will update the “left-most” environment, and then you use the Cloud portal to update the Live site.
99
+
### Debugging
91
100
92
-
If you only have only one environment then the GitHub action will try to deploy directly to live. So please be warned that if there’s something wrong with the GitHub action it might take down your live site. If that happens (and it did for me!) then I debugged this by looking at the commit that was made to the Cloud repository during the deployment. The website `.csproj` is a good place to check first!
101
+
Please be warned that if there’s something wrong with the GitHub action, it might take down your target site. If that happens (and it did for me several times whilst working on it!) then I debugged by looking at the commit that was made to the Cloud repository during the deployment. The website `.csproj` is a good place to check first!
0 commit comments