For the complete documentation index, see llms.txt. This page is also available as Markdown.

GitHub Actions

Steps and examples on how to setup a build and deployment pipeline for Umbraco Deploy using GitHub Actions.

This example shows how you can set up a CI/CD build server using GitHub Actions in Azure Web Apps.

Setting up the site itself is not covered here, as this is beyond this documentation.

The following steps will take you through setting up a build server in Azure Web Apps. Go to the Azure portal and find the empty website that you have set up and want to connect to.

  1. Go to the Deployment Center.

Azure deployments

In the Deployment Center, you can set up the CI/CD build server. This example sets up the build server using GitHub Actions. It is possible to set up the build server however you want as long as it supports executing Powershell scripts.

  1. Go to the Settings tab.

  2. Choose which source and build provider to use.

    • In this case, choose GitHub.

Build server clean
  1. Choose the Organization which you created the GitHub repository under.

  2. Choose the repository that was set up earlier in this guide.

  3. Select which branch you want the build server to build into.

The runtime stack and version being used can be seen here. In this example, .NET Version 6.0 is used.

Once the information has been added, preview the YAML file that will be used for the build server:

Workflow configuration
  1. Save the workflow.

The website and the GitHub repository are now connected.

Going back to the GitHub repository, a new folder has been created called Workflows:

Workflows

Inside the folder, the YAML file has been created with the default settings from the Azure Portal. The file will need to be configured so it fits into your set up.

  1. Pull down the new file and folder, so you can work with the YAML file on your local machine.

  2. Configure it to work with your Umbraco Deploy installation.

When it have been configured it will look something like this:

This is only an example of how you can set up the CI/CD pipeline for Umbraco Deploy. It is possible to set it up in a way that works for you and your preferred workflow.

Also add the License file and TriggerDeploy.ps1 file in an item group in the csproj file:

As well as enabling Unattended install in the appsettings.json file so Umbraco installs automatically:

Before the build can work, set up the generated API key to work with the build server in GitHub Actions.

  1. Open your GitHub repository.

  2. Navigate to Settings.

  3. Go to the Secrets tab.

  4. Select "New repository secret".

  5. Call the new secret "DEPLOYAPISECRET".

  6. Add the API secret from the appsettings.json file (replace ApiSecet with ApiKey in the script and use the corresponding value if you're using the deprecated API key setting instead).

  7. Save the secret.

Commit the configured YAML file and push up all the files to the repository.

Go to GitHub where you will now be able to see that the CI/CD build has started running:

Deployment build started

The build server will go through the steps in the YAML file, and once it is done the deployment have gone through successfully:

Deployment Complete

You can now start creating content on the local machine. Once you create something like a Document Type, the changes will get picked up in Git.

When you're done making changes, commit them and deploy them to GitHub. The build server will run and extract the changes into the website in Azure.

This will only deploy the schema data for the local site to your website.

You will need to transfer content and media from the backoffice on your local project using the queue for transfer feature.

Last updated

Was this helpful?