diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2022-05-20 11:28:24 +0200 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2022-05-20 11:31:15 +0200 |
commit | 8884c99b7aea2306b217af2a4e5bcaddad178fd6 (patch) | |
tree | f2955a1386e4a3ccd4c95c3b070ec498485c4f96 | |
parent | Makefile: fix clean recipe (diff) | |
download | cv-8884c99b7aea2306b217af2a4e5bcaddad178fd6.tar.gz cv-8884c99b7aea2306b217af2a4e5bcaddad178fd6.zip |
workflows/build: rsync PDF to server
-rw-r--r-- | .github/workflows/build.yml | 10 | ||||
-rw-r--r-- | Makefile | 12 |
2 files changed, 22 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3217277..f480bdc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,3 +29,13 @@ jobs: folder: cv single-commit: true if: github.ref == 'refs/heads/master' + - 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 }}' @@ -49,6 +49,18 @@ $(pdf): $(name).tex img/face2020_warm.jpg | $(name)/ view: xdg-open '$(call escape,$(pdf))' &> /dev/null +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' '$(call escape,$(name)/)' '$(call escape,$(REMOTE_USER)@$(REMOTE_HOST):$(REMOTE_DIR)/)' --delete + .PHONY: clean clean: find '$(call escape,$(name))' '!' -name '$(call escape,$(name).pdf)' -type f -delete |