forked from myoung34/docker-github-actions-runner
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
40 lines (32 loc) · 1.41 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
35
36
37
38
39
40
IMAGE_NAME = guilhermebruzzi/github-runner
DOCKER_NAME = github-runner
docker-login:
@docker login docker.pkg.github.com -u USERNAME --password "${GITHUB_ACTIONS_TOKEN}"
setup: docker-login
yarn
docker-build: setup
docker build -t $(IMAGE_NAME) .
docker-remove:
docker stop $(DOCKER_NAME) || true && docker rm $(DOCKER_NAME) || true
docker-run: docker-build docker-remove
docker run --name $(DOCKER_NAME) --memory="1g" \
-e REPO_URL="https://github.com/vtex/checkout-instore/" \
-e RUNNER_NAME="INSTORE-VTEX-DOCKER-SELF-HOSTED-RUNNER" \
-e ACCESS_TOKEN="${GITHUB_ACTIONS_TOKEN}" \
-e RUNNER_WORKDIR="/tmp/INSTORE-VTEX-DOCKER-SELF-HOSTED-RUNNER" \
-e RUNNER_LABELS="instore" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/INSTORE-VTEX-DOCKER-SELF-HOSTED-RUNNER:/tmp/INSTORE-VTEX-DOCKER-SELF-HOSTED-RUNNER \
$(IMAGE_NAME):latest
docker-run-it: docker-build docker-remove
docker run -it --entrypoint /bin/bash --name $(DOCKER_NAME) \
-e REPO_URL="https://github.com/vtex/checkout-instore/" \
-e RUNNER_NAME="INSTORE-VTEX-DOCKER-SELF-HOSTED-RUNNER" \
-e ACCESS_TOKEN="${GITHUB_ACTIONS_TOKEN}" \
-e RUNNER_WORKDIR="/tmp/INSTORE-VTEX-DOCKER-SELF-HOSTED-RUNNER" \
-e RUNNER_LABELS="instore" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/INSTORE-VTEX-DOCKER-SELF-HOSTED-RUNNER:/tmp/INSTORE-VTEX-DOCKER-SELF-HOSTED-RUNNER \
$(IMAGE_NAME):latest
deploy: setup
./node_modules/.bin/releasy --stable