@@ -3,23 +3,26 @@ SRC_DIR := _source/developer-framework
3
3
DEST_DIR_NB := notebooks
4
4
DEST_DIR_PYTHON := _site/validmind
5
5
DEST_DIR_TESTS := tests
6
+ GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
6
7
7
8
# Define .PHONY target for help section
8
- .PHONY : help clean clone notebooks python-docs docs-site deploy-demo deploy-prod release-notes
9
+ .PHONY : help clean clone notebooks python-docs docs-site deploy-demo deploy-demo-branch delete-demo-branch deploy- prod release-notes
9
10
10
11
# Help section
11
12
help :
12
13
@echo " Available targets:"
13
- @echo " clean Remove the _source/ directory"
14
- @echo " clone Clone the developer-framework repository into _source/"
15
- @echo " notebooks Copy Jupyter notebooks into notebooks/"
16
- @echo " python-docs Copy the Python library docs into _site/validmind"
17
- @echo " get-source Get all source files (clean, clone, notebooks, python-docs)"
18
- @echo " docs-site Get all source files and render the docs site with Quarto"
19
- @echo " deploy-demo Render the docs site & deploy to docs-ci-cd-demo and clear cache"
20
- @echo " deploy-prod Render the docs site & deploy to docs-ci-cd-prod and clear cache"
21
- @echo " help Display this help message (default target)"
22
- @echo " release-notes Generate release notes from pull requests since latest tag and update _quarto.yml"
14
+ @echo " clean Remove the _source/ directory"
15
+ @echo " clone Clone the developer-framework repository into _source/"
16
+ @echo " notebooks Copy Jupyter notebooks into notebooks/"
17
+ @echo " python-docs Copy the Python library docs into _site/validmind"
18
+ @echo " get-source Get all source files (clean, clone, notebooks, python-docs)"
19
+ @echo " docs-site Get all source files and render the docs site with Quarto"
20
+ @echo " deploy-demo Deploy docs demo site to s3://docs-ci-cd-demo/site/"
21
+ @echo " deploy-demo-branch Deploy docs demo site to s3://docs-ci-cd-demo/site/pr_previews/$( GIT_BRANCH) /"
22
+ @echo " delete-demo-branch Delete docs demo site in s3://docs-ci-cd-demo/site/pr_previews/$( GIT_BRANCH) /"
23
+ @echo " deploy-prod Deploy docs prod site to s3://docs-ci-cd-prod/site/"
24
+ @echo " help Display this help message (default target)"
25
+ @echo " release-notes Generate release notes from pull requests since latest tag and update _quarto.yml"
23
26
24
27
# Clean up source directory
25
28
clean :
@@ -82,9 +85,19 @@ deploy-demo:
82
85
echo " You're not on the docs-demo branch, no action taken." ; \
83
86
else \
84
87
echo " \nDeploying docs-demo site ..." ; \
85
- quarto render && aws s3 sync ./_site s3://docs-ci-cd-demo/site/ --delete && aws cloudfront create-invalidation --distribution-id E38AINJY5CYN6P --paths " /*" --no-cli-pager > /dev/null; \
88
+ quarto render && aws s3 sync ./_site s3://docs-ci-cd-demo/site/ && aws cloudfront create-invalidation --distribution-id E38AINJY5CYN6P --paths " /*" --no-cli-pager > /dev/null; \
86
89
fi
87
90
91
+ # Deploy PR branch to https://docs-demo.vm.validmind.ai/
92
+ deploy-demo-branch :
93
+ @quarto render && aws s3 sync ./_site s3://docs-ci-cd-demo/site/pr_previews/$(GIT_BRANCH ) / --delete && aws cloudfront create-invalidation --distribution-id E38AINJY5CYN6P --paths " /*" --no-cli-pager > /dev/null;
94
+ @echo " \nDeployed to https://docs-demo.vm.validmind.ai/pr_previews/$( GIT_BRANCH) /index.html"
95
+
96
+ # Delete PR branch on https://docs-demo.vm.validmind.ai/
97
+ delete-demo-branch :
98
+ @aws s3 rm s3://docs-ci-cd-demo/site/pr_previews/$(GIT_BRANCH ) / --recursive && aws cloudfront create-invalidation --distribution-id E38AINJY5CYN6P --paths " /*" --no-cli-pager > /dev/null;
99
+ @echo " \nDeleted https://docs-demo.vm.validmind.ai/pr_previews/$( GIT_BRANCH) /"
100
+
88
101
# Deployment to https://docs.validmind.ai/
89
102
deploy-prod :
90
103
@if [ " ` git rev-parse --abbrev-ref HEAD` " != " prod" ]; then \
0 commit comments