Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,21 @@ jobs:
- name: Install dependencies
run: make install

- name: Get current branch name
run: |
BRANCH_NAME=$(make safe_branch BRANCH=$GITHUB_BRANCH_NAME)
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV

- name: Build the website
run: make build PREVIEW=true
run:
make build PREVIEW=true
SITE_URL="https://${BRANCH_NAME}.ep-preview.click"

- name: Set up SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.DEPLOY_SSH_KEY }}

- name: Get current branch name
run: |
BRANCH_NAME=$(make safe_branch BRANCH=$GITHUB_BRANCH_NAME)
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV

- name: ssh keyscan
run: ssh-keyscan "static.europython.eu" > ~/.ssh/known_hosts

Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ build:
commands:
- npm install -g pnpm@latest-10
- make install
- make build PREVIEW=true
- make build PREVIEW=true SITE_URL=$READTHEDOCS_CANONICAL_URL
- mkdir -p $READTHEDOCS_OUTPUT/html
- cd dist && cp -r * $READTHEDOCS_OUTPUT/html
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ VPS_HOST ?= static.europython.eu
VPS_PROD_PATH ?= /home/static_content_user/content/europython_websites/ep2025
VPS_PREVIEW_PATH ?= /home/static_content_user/content/previews
REMOTE_CMD=ssh $(VPS_USER)@$(VPS_HOST)
PREVIEW_SITE_URL ?= "https://$(SAFE_BRANCH).ep-preview.click"

# Variables for build/deploy
# ==========================
Expand Down Expand Up @@ -47,12 +48,14 @@ build:
preview: RELEASES_DIR = $(VPS_PREVIEW_PATH)/$(SAFE_BRANCH)/releases
preview: TARGET = $(RELEASES_DIR)/$(TIMESTAMP)
preview:
@echo "Preview site URL: $(PREVIEW_SITE_URL)"
echo $(TARGET)
@echo "\n\n**** Deploying preview of a branch '$(BRANCH)' (safe: $(SAFE_BRANCH)) to $(TARGET)...\n\n"
$(REMOTE_CMD) "mkdir -p $(TARGET)"
rsync -avz --delete ./dist/ $(VPS_USER)@$(VPS_HOST):$(TARGET)/
$(REMOTE_CMD) "cd $(RELEASES_DIR) && ln -snf $(TIMESTAMP) current"
@echo "\n\n**** Preview complete.\n\n"
@echo "Open the preview site at: $(PREVIEW_SITE_URL)\n\n"


ifeq ($(FORCE_DEPLOY), true)
Expand Down