-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (27 loc) · 1.05 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
.PHONY: dev build gh-pages build-prod gdoc gsheet
build-prod: export NODE_ENV = production
build-prod: build
install:
yarn install
rm -rf dist/
git worktree add -b gh-pages dist
dev:
yarn run dev
gdoc:
yarn sink gdoc
gsheet:
yarn sink gsheet
build:
rm -rf build/*
rm -rf dist/*
yarn run build
gh-pages: SITE = $(shell python -c "import json; print(json.load(open('config.json'))['deployment']);")
gh-pages: REPO = $(shell basename -s .git `git remote get-url origin`)
gh-pages: PAGES = "https://github.com/MichiganDaily/$(REPO)/settings/pages"
gh-pages: build-prod
(cd dist; git add --all)
(cd dist; git commit -m "Build output as of $(shell git log '--format=format:%H' main -1)" || echo "No changes to commit.")
(cd dist; git pull -s ours --no-edit origin gh-pages || echo "Could not pull from origin.")
(cd dist; git push -u origin gh-pages)
@echo "🔐 \033[93mRemember to enforce HTTPS in the repository settings at $(PAGES)\033[0m"
@echo "🍪 \033[1mAfter enforcement, your graphic will be deployed at\033[0m \033[1;96m$(SITE)/$(REPO)\033[0m"