StaticDeploy allows for a variety of workflows for the continuous integration, delivery, and deployment of a static app.
To implement them, first of all we should set up our CI server to build the app and create a bundle for the build on each commit. We can choose to tag the bundle with the name of the branch our commit was added to, or even with the sha of the commit. For instance, for a react app in our CI server we could do something like:
# Build the app, saving static artifacts into the build/ folder npm run build # Create a bundle from that folder staticdeploy bundle \ --from build/ --name example-app \ --tag $BRANCH \ --description "Build of commit $COMMIT"
Then, we could choose to:
automatically deploy each branch to
staticdeploy deploy --app example-app --entrypoint $BRANCH.example-app.com/ --bundle example-app:$BRANCH
automatically deploy git tags to
example-app.com/$TAG/(can be useful for versioning documentation websites):
staticdeploy deploy --app example-app --entrypoint example-app.com/$TAG/ --bundle example-app:$TAG
masterto the production environment:
staticdeploy deploy --app example-app --entrypoint example-app.com/ --bundle example-app:master
manually deploy to production using StaticDeploy's admin console