2020-02-05 05:34:19 +00:00
|
|
|
cmd := "bash"
|
|
|
|
msg := ""
|
2020-07-08 20:33:46 +00:00
|
|
|
IMAGE_NAME := docker.pkg.github.com/peaceiris/actions-gh-pages/dev:latest
|
2020-02-05 05:34:19 +00:00
|
|
|
NODE_VERSION := $(shell cat ./.nvmrc)
|
|
|
|
DOCKER_RUN := docker run --rm -i -t -v ${PWD}:/repo -v ~/.gitconfig:/root/.gitconfig $(IMAGE_NAME)
|
2020-03-25 10:37:45 +00:00
|
|
|
DOCKER_RUN_CI := docker run --rm -v ${PWD}:/repo $(IMAGE_NAME)
|
2020-02-05 05:34:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
.PHONY: build
|
|
|
|
build:
|
2020-07-08 20:33:46 +00:00
|
|
|
docker build . \
|
|
|
|
--build-arg NODE_VERSION=$(NODE_VERSION) \
|
|
|
|
--cache-from=${IMAGE_NAME} \
|
|
|
|
-t $(IMAGE_NAME)
|
|
|
|
|
|
|
|
.PHONY: pull
|
|
|
|
pull:
|
|
|
|
docker pull ${IMAGE_NAME}
|
|
|
|
|
|
|
|
.PHONY: push
|
|
|
|
push:
|
|
|
|
docker push ${IMAGE_NAME}
|
2020-02-05 05:34:19 +00:00
|
|
|
|
|
|
|
.PHONY: run
|
|
|
|
run:
|
|
|
|
$(DOCKER_RUN) $(cmd)
|
|
|
|
|
2020-03-25 10:37:45 +00:00
|
|
|
.PHONY: cirun
|
|
|
|
cirun:
|
|
|
|
$(DOCKER_RUN_CI) $(cmd)
|
|
|
|
|
2020-02-05 05:34:19 +00:00
|
|
|
.PHONY: test
|
|
|
|
test:
|
|
|
|
$(DOCKER_RUN) npm test
|
|
|
|
|
|
|
|
.PHONY: commit
|
|
|
|
commit:
|
|
|
|
$(DOCKER_RUN) git commit -m "$(msg)"
|
2020-03-16 00:43:59 +00:00
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all:
|
|
|
|
$(DOCKER_RUN) npm run all
|
2020-03-25 10:37:45 +00:00
|
|
|
|
|
|
|
.PHONY: ciall
|
|
|
|
ciall:
|
|
|
|
$(DOCKER_RUN_CI) npm run all
|