Skip to content

Commit d380a54

Browse files
committed
udpate setup instructions now that using V2 API endpoints
1 parent a6c7540 commit d380a54

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

Setup.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ So you now have a working local site running the latest codebase, with no sensit
5555

5656
## Getting Changes Back to Cloud
5757

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.
5959

6060
In your GitHub repository go to Settings > Security > Secrets and Variables > Actions. There are two tabs, one for Secrets and one for Variables.
6161

@@ -69,27 +69,36 @@ On the Secrets tab, create the following Repository Secrets:
6969

7070
Now do the following updates to your repository:
7171

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)
7373

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)
7575

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.
7785

7886
1. In the root of your repository add the `cloud.zipignore` file that you can copy from [here](cloud.zipignore)
7987

8088
1. Copy your `.gitignore` file in the root of your repository and rename the copy to be `cloud.gitignore`
8189

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
8391

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.
8594
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` branch is updated, or when it’s manually triggered (via the GitHub website Actions tab).
8796

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!
8998

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
91100

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!
93102

94103
## Sharing Content and Media Updates
95104

0 commit comments

Comments
 (0)