ci: Add docker-compose.yml (#406)

This commit is contained in:
Shohei Ueda authored and GitHub committed 2020-07-21 19:37:23 +09:00
1 parent 09b03c0bb1
commit a2712f7b92
3 files changed
+29 -35

No files matched your search

+7 -31
View File
@@ -1,46 +1,22 @@
cmd := "bash"
msg := ""
IMAGE_NAME := docker.pkg.github.com/peaceiris/actions-gh-pages/dev:latest
NODE_VERSION := $(shell cat ./.nvmrc)
DOCKER_RUN := docker run --rm -i -t -v ${PWD}:/repo -v ~/.gitconfig:/root/.gitconfig $(IMAGE_NAME)
DOCKER_RUN_CI := docker run --rm -v ${PWD}:/repo $(IMAGE_NAME)
.PHONY: build
build:
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}
docker-compose build --build-arg NODE_VERSION=$(NODE_VERSION)
.PHONY: run
run:
$(DOCKER_RUN) $(cmd)
docker-compose run --rm dev bash
.PHONY: cirun
cirun:
$(DOCKER_RUN_CI) $(cmd)
.PHONY: ci
ci:
docker-compose run --rm -T dev npm ci
.PHONY: test
test:
$(DOCKER_RUN) npm test
.PHONY: commit
commit:
$(DOCKER_RUN) git commit -m "$(msg)"
docker-compose run --rm -T dev npm test
.PHONY: all
all:
$(DOCKER_RUN) npm run all
.PHONY: ciall
ciall:
$(DOCKER_RUN_CI) npm run all
docker-compose run --rm -T dev npm run all