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:
32
32
- name : Install dependencies
33
33
run : make install
34
34
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
+
35
40
- 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"
37
44
38
45
- name : Set up SSH key
39
46
uses :
webfactory/[email protected]
40
47
with :
41
48
ssh-private-key : ${{ secrets.DEPLOY_SSH_KEY }}
42
49
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
-
48
50
- name : ssh keyscan
49
51
run : ssh-keyscan "static.europython.eu" > ~/.ssh/known_hosts
50
52
Original file line number Diff line number Diff line change 20
20
commands :
21
21
- npm install -g pnpm@latest-10
22
22
- make install
23
- - make build PREVIEW=true
23
+ - make build PREVIEW=true SITE_URL=$READTHEDOCS_CANONICAL_URL
24
24
- mkdir -p $READTHEDOCS_OUTPUT/html
25
25
- 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
6
6
VPS_PROD_PATH ?= /home/static_content_user/content/europython_websites/ep2025
7
7
VPS_PREVIEW_PATH ?= /home/static_content_user/content/previews
8
8
REMOTE_CMD =ssh $(VPS_USER ) @$(VPS_HOST )
9
+ PREVIEW_SITE_URL ?= "https://$(SAFE_BRANCH ) .ep-preview.click"
9
10
10
11
# Variables for build/deploy
11
12
# ==========================
@@ -47,13 +48,14 @@ build:
47
48
preview : RELEASES_DIR = $(VPS_PREVIEW_PATH ) /$(SAFE_BRANCH ) /releases
48
49
preview : TARGET = $(RELEASES_DIR ) /$(TIMESTAMP )
49
50
preview :
50
- @echo " Preview site URL: $( SITE_URL ) " # Output preview URL
51
+ @echo " Preview site URL: $( PREVIEW_SITE_URL ) "
51
52
echo $(TARGET )
52
53
@echo " \n\n**** Deploying preview of a branch '$( BRANCH) ' (safe: $( SAFE_BRANCH) ) to $( TARGET) ...\n\n"
53
54
$(REMOTE_CMD ) " mkdir -p $( TARGET) "
54
55
rsync -avz --delete ./dist/ $(VPS_USER ) @$(VPS_HOST ) :$(TARGET ) /
55
56
$(REMOTE_CMD ) " cd $( RELEASES_DIR) && ln -snf $( TIMESTAMP) current"
56
57
@echo " \n\n**** Preview complete.\n\n"
58
+ @echo " Open the preview site at: $( PREVIEW_SITE_URL) \n\n"
57
59
58
60
59
61
ifeq ($(FORCE_DEPLOY ) , true)
You can’t perform that action at this time.
0 commit comments