Browse Source

Use a Makefile

pull/8/head
earnest ma 5 months ago
parent
commit
9ea7db6818
Signed by: earnest ma
GPG Key ID: A343F43342EB6E2A
  1. 3
      .editorconfig
  2. 14
      .vscode/tasks.json
  3. 40
      Makefile

3
.editorconfig

@ -10,3 +10,6 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[Makefile]
indent_style = tab

14
.vscode/tasks.json vendored

@ -4,24 +4,12 @@
{
"label": "Run watch",
"type": "shell",
"command": "hugo server",
"command": "make serve",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
},
{
"label": "Make",
"type": "shell",
"command": "make",
"problemMatcher": []
},
{
"label": "Make lint",
"type": "shell",
"command": "make lint",
"problemMatcher": []
}
]
}

40
Makefile

@ -0,0 +1,40 @@
DOMAIN = earnestma.com
HUGO_BASEURL = https://$(DOMAIN)/
HUGO_FLAGS += --gc
USER = earne@$(DOMAIN)
WWW_ROOT = /home/earne/$(DOMAIN)
WWW_RSYNC_DEST = $(USER):$(WWW_ROOT)
OUTPUT_DIR = public
.PHONY: hugo
hugo: clean
hugo -b $(HUGO_BASEURL) $(HUGO_FLAGS)
.PHONY: clean
clean:
rm -rf $(OUTPUT_DIR)
.PHONY: serve
serve:
hugo serve
.PHONY: bookwyrmrssjson
bookwyrmrssjson:
curl "https://api.rss2json.com/v1/api.json?rss_url=https%3A%2F%2Fbookwyrm.social%2Fuser%2Fearnestma%2Frss" -o data/bookwyrm.json
.PHONY: build
build: bookwyrmrssjson hugo
.PHONY: deploy-main
deploy-main: build
rsync $(OUTPUT_DIR)/ $(WWW_RSYNC_DEST)/ -ravz --delete
.PHONY: deploy-staging
deploy-staging: DOMAIN = staging.earnestma.xyz
deploy-staging: build
rsync $(OUTPUT_DIR)/ $(WWW_RSYNC_DEST)/ -ravz --delete
.PHONY: all
all: deploy-main
Loading…
Cancel
Save