Skip to content

Commit 360c898

Browse files
committed
add conditional flag for deployment
1 parent 7dc2670 commit 360c898

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.github/workflows/build-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ jobs:
4545
run: ssh-keyscan "static.europython.eu" > ~/.ssh/known_hosts
4646

4747
- name: Deploy to server
48-
run: make deploy
48+
run: make deploy FORCE_DEPLOY=true

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export GIT_VERSION ?= $(shell git rev-parse --short HEAD)
1818
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
1919
# Replace "/" and other non-alphanumeric characters with "-"
2020
SAFE_BRANCH := $(shell echo "$(BRANCH)" | sed 's/[^A-Za-z0-9._-]/-/g')
21+
FORCE_DEPLOY ?= false
2122

2223
# TODO: update this to the prod branches
2324
ifeq ($(SAFE_BRANCH), deployment-simpler)
@@ -48,9 +49,11 @@ build:
4849
# NOTE: also let's find a better way to do this :D
4950
find ./dist/_astro/ -iname '*.jpg' -delete
5051

52+
ifeq ($(FORCE_DEPLOY), true)
5153
deploy:
52-
@echo "\n\n**** Deploying branch '$(BRANCH)' (safe: $(SAFE_BRANCH)) to $(TARGET)...\n\n"
53-
$(REMOTE_CMD) "mkdir -p $(TARGET)"
54-
rsync -avz --delete ./dist/ $(VPS_USER)@$(VPS_HOST):$(TARGET)/
55-
$(REMOTE_CMD) "cd $(RELEASES_DIR) && ln -snf $(TIMESTAMP) current"
56-
@echo "\n\n**** Deployment complete.\n\n"
54+
@echo "\n\n**** Deploying branch '$(BRANCH)' (safe: $(SAFE_BRANCH)) to $(TARGET)...\n\n"
55+
$(REMOTE_CMD) "mkdir -p $(TARGET)"
56+
rsync -avz --delete ./dist/ $(VPS_USER)@$(VPS_HOST):$(TARGET)/
57+
$(REMOTE_CMD) "cd $(RELEASES_DIR) && ln -snf $(TIMESTAMP) current"
58+
@echo "\n\n**** Deployment complete.\n\n"
59+
endif

0 commit comments

Comments
 (0)