forked from dddwa/dddperth-website
-
Notifications
You must be signed in to change notification settings - Fork 1
Website deployment process
Aaron Powell edited this page Jun 24, 2019
·
5 revisions
The website runs as a static website within the Azure subscription for DDD Sydney (if you want access to that you'll need to be in the O365 org, speak to Aaron or Steve in that case).
Aaron has blogged about the approach in the past, and the reasons why it is the way it is.
For the deployments an Azure Pipeline is run, you can see it here using the yaml pipeline. This is automatically triggered when a push is made to GitHub and runs the following process:
- Cloning the git repo
- Install the node modules
- Build the next.js app
- Export the next.js app to a static site
- Copy the export as an artifact
You can run all of these commands on your local machine too.
Once a build has completed a release is triggered and it will:
- Download the artifact from the build
- Unpack the files
- Use the Azure Blob Copy tool to upload the files to an Azure storage account
- Note: The files are placed in a new folder in the storage account numbered with the
ReleaseId
so we don't replace any previously deployed site, and it means we can roll back easily.
- Note: The files are placed in a new folder in the storage account numbered with the
- Update Azure CDN to know about the new files
- When you push to
master
it'll "just build", unless you fail the build (hard to do, but you can do it) - A deployment can take up to 30 minutes, Azure CDN is slow to propagate changes, so if the release ran but you don't see your changes, just wait a little longer
- We have SSL, it's provided by Azure CDN, but it doesn't force the SSL redirect at the moment 😠
- The DNS is managed by Aaron in DNSimple, but you shouldn't need to change anything there