File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -32,19 +32,21 @@ jobs:
3232 - name : Install dependencies
3333 run : make install
3434
35+ - name : Get current branch name
36+ run : |
37+ BRANCH_NAME=$(make safe_branch BRANCH=$GITHUB_BRANCH_NAME)
38+ echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
39+
3540 - name : Build the website
36- run : make build PREVIEW=true
41+ run :
42+ make build PREVIEW=true
43+ SITE_URL="https://${BRANCH_NAME}.ep-preview.click"
3744
3845 - name : Set up SSH key
3946 uses :
webfactory/[email protected] 4047 with :
4148 ssh-private-key : ${{ secrets.DEPLOY_SSH_KEY }}
4249
43- - name : Get current branch name
44- run : |
45- BRANCH_NAME=$(make safe_branch BRANCH=$GITHUB_BRANCH_NAME)
46- echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
47-
4850 - name : ssh keyscan
4951 run : ssh-keyscan "static.europython.eu" > ~/.ssh/known_hosts
5052
Original file line number Diff line number Diff line change 2020 commands :
2121 - npm install -g pnpm@latest-10
2222 - make install
23- - make build PREVIEW=true
23+ - make build PREVIEW=true SITE_URL=$READTHEDOCS_CANONICAL_URL
2424 - mkdir -p $READTHEDOCS_OUTPUT/html
2525 - cd dist && cp -r * $READTHEDOCS_OUTPUT/html
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ VPS_HOST ?= static.europython.eu
66VPS_PROD_PATH ?= /home/static_content_user/content/europython_websites/ep2025
77VPS_PREVIEW_PATH ?= /home/static_content_user/content/previews
88REMOTE_CMD =ssh $(VPS_USER ) @$(VPS_HOST )
9+ PREVIEW_SITE_URL ?= "https://$(SAFE_BRANCH ) .ep-preview.click"
910
1011# Variables for build/deploy
1112# ==========================
@@ -47,13 +48,14 @@ build:
4748preview : RELEASES_DIR = $(VPS_PREVIEW_PATH ) /$(SAFE_BRANCH ) /releases
4849preview : TARGET = $(RELEASES_DIR ) /$(TIMESTAMP )
4950preview :
50- @echo " Preview site URL: $( SITE_URL ) " # Output preview URL
51+ @echo " Preview site URL: $( PREVIEW_SITE_URL ) "
5152 echo $(TARGET )
5253 @echo " \n\n**** Deploying preview of a branch '$( BRANCH) ' (safe: $( SAFE_BRANCH) ) to $( TARGET) ...\n\n"
5354 $(REMOTE_CMD ) " mkdir -p $( TARGET) "
5455 rsync -avz --delete ./dist/ $(VPS_USER ) @$(VPS_HOST ) :$(TARGET ) /
5556 $(REMOTE_CMD ) " cd $( RELEASES_DIR) && ln -snf $( TIMESTAMP) current"
5657 @echo " \n\n**** Preview complete.\n\n"
58+ @echo " Open the preview site at: $( PREVIEW_SITE_URL) \n\n"
5759
5860
5961ifeq ($(FORCE_DEPLOY ) , true)
You can’t perform that action at this time.
0 commit comments