Skip to content

Commit 66fa80a

Browse files
committed
Use buildkit for parallel builds and try to cache where possible
1 parent a3802a5 commit 66fa80a

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

Diff for: .github/workflows/ci.yml

+22-12
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,17 @@ jobs:
7575
steps:
7676
- uses: actions/checkout@v2
7777

78+
- name: Set up Docker BuildKit
79+
uses: docker/setup-buildx-action@v1
80+
with:
81+
install: true
82+
7883
- name: Set up Node
7984
uses: actions/setup-node@v2
8085
with:
8186
node-version: "15.14"
87+
cache: "yarn"
88+
cache-dependency-path: ./webapp/yarn.lock
8289

8390
- name: Install web app
8491
working-directory: ./webapp
@@ -92,21 +99,24 @@ jobs:
9299
working-directory: ./webapp
93100
run: yarn build
94101

95-
- name: Build the Docker app image
96-
run: docker-compose build app
97-
98-
- name: Build the Docker server image
99-
run: docker-compose build api
100-
101-
- name: Build the Docker mongo image
102-
run: docker-compose build mongo
102+
- name: Build the Docker images
103+
env:
104+
COMPOSE_DOCKER_CLI_BUILD: 1
105+
DOCKER_BUILDKIT: 1
106+
run: |
107+
docker compose --profile prod build
103108
104109
- name: Start Docker images
110+
env:
111+
COMPOSE_DOCKER_CLI_BUILD: 1
112+
DOCKER_BUILDKIT: 1
113+
# Wait for port to open in docker image before next step
105114
run: |
106-
docker-compose up --abort-on-container-exit &
107-
sleep 60
108-
exit 0
115+
docker compose --profile prod up --abort-on-container-exit &
116+
sudo apt install -y wait-for-it
117+
wait-for-it localhost:8081 -t 120
109118
110119
- name: Run end-to-end tests
111120
working-directory: ./webapp
112-
run: yarn test:e2e --headless --url http://localhost:8081
121+
run: |
122+
yarn test:e2e --headless --url http://localhost:8081

0 commit comments

Comments
 (0)