Skip to content

Commit f0a2e29

Browse files
committed
chore: update build tools
1 parent 1737cb6 commit f0a2e29

File tree

4 files changed

+51
-13
lines changed

4 files changed

+51
-13
lines changed

.dockerignore

-2
This file was deleted.

.github/linters/.grype.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
check-for-app-update: false
2+
exclude:
3+
- '**/package-lock.json'

Makefile

+21-5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
# Note: this file originates in template-action-docker #
55
# ---------------------------------------------------- #
66

7-
SHELL := /bin/bash
8-
97
pull: ## pull latest containers
108
@docker compose pull
119

@@ -15,15 +13,33 @@ lint: clean ## run mega-linter
1513
readme: clean ## run readme action
1614
@docker compose run --rm readme
1715

18-
start: ## start the project in foreground
19-
@docker compose run $(shell env | grep DOCKER | sed -E 's/DOCKER_(.*?)=(.*)/-e \1="\2"/gm;t;d') app
20-
2116
build: clean ## start the project in background
2217
@docker compose build --no-cache app
2318

2419
shell: ## start the container shell
2520
@docker compose run --rm --entrypoint /bin/sh app
2621

22+
install: ## install all dependencies
23+
@docker compose run --rm app install
24+
25+
start: ## start the project in foreground
26+
@docker compose run --rm app
27+
28+
test: ## run all npm tests
29+
@docker compose run --rm app-test
30+
31+
build-action: clean ## start the project in background
32+
@docker compose build --no-cache action
33+
34+
shell-action: ## start the container shell
35+
@docker compose run --rm --entrypoint /bin/sh action
36+
37+
start-action: ## start the project in foreground
38+
@docker compose run --rm action
39+
40+
test-action: ## start the project in foreground
41+
@docker compose run --rm action-test
42+
2743
stop: ## stop all running containers
2844
@docker compose down --remove-orphans --rmi local
2945

docker-compose.yml

+27-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
# ---- mega-linter ---- #
77
lint:
88
profiles: ["dev"]
9-
image: oxsecurity/megalinter-javascript:v6.20.1
9+
image: oxsecurity/megalinter:v7.2.1
1010
volumes:
1111
- ./:/tmp/lint
1212
environment:
@@ -22,13 +22,34 @@ services:
2222
- ./:/data
2323
command: --defaults=.pandoc.yml
2424

25-
# ---- app ---- #
25+
# ---- action container ---- #
26+
action:
27+
profiles: ["action"]
28+
build: .
29+
30+
action-test:
31+
extends: action
32+
profiles: ["action"]
33+
volumes:
34+
- ./test:/github/workspace/test
35+
- .git:/github/workspace/.git
36+
env_file:
37+
- .env
38+
39+
# ---- main container ---- #
2640
app:
2741
profiles: ["app"]
28-
privileged: true
29-
build: .
30-
working_dir: /github/workspace
42+
image: node:20-alpine
43+
working_dir: /app
44+
entrypoint: npm --no-update-notifier --no-fund --no-audit
45+
command: start
46+
tty: true
3147
volumes:
32-
- ./:/github/workspace
48+
- ./:/app
3349
env_file:
3450
- .env
51+
52+
app-test:
53+
extends: app
54+
profiles: ["test"]
55+
command: run test:ci -- --reporter=classic

0 commit comments

Comments
 (0)