diff options
Diffstat (limited to '')
-rw-r--r-- | .github/workflows/jekyll.yml | 10 | ||||
-rw-r--r-- | Makefile | 12 |
2 files changed, 22 insertions, 0 deletions
diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index b6be8fa..f74a22b 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -26,3 +26,13 @@ jobs: run: | nohup make serve & sleep 3 && make wget + - name: Set up ssh-agent + uses: webfactory/ssh-agent@v0.5.3 + with: + ssh-private-key: '${{ secrets.REMOTE_SSH_KEY }}' + - name: Deploy + run: make deploy + env: + REMOTE_USER: '${{ secrets.REMOTE_USER }}' + REMOTE_HOST: '${{ secrets.REMOTE_HOST }}' + REMOTE_DIR: '${{ secrets.REMOTE_DIR }}' @@ -63,3 +63,15 @@ bundle: assets/js/bundle.js assets/js/bundle.js: package-lock.json npm exec -- browserify --require ip-address --outfile '$(call escape,$@)' + +REMOTE_USER ?= who +REMOTE_HOST ?= where +REMOTE_DIR ?= /path/to/dir + +$(eval $(call noexpand,REMOTE_USER)) +$(eval $(call noexpand,REMOTE_HOST)) +$(eval $(call noexpand,REMOTE_DIR)) + +.PHONY: deploy +deploy: + rsync -avh -e 'ssh -o StrictHostKeyChecking=no' _site/ '$(call escape,$(REMOTE_USER)@$(REMOTE_HOST):$(REMOTE_DIR)/)' --delete |