@@ -75,10 +75,17 @@ jobs:
75
75
steps :
76
76
- uses : actions/checkout@v2
77
77
78
+ - name : Set up Docker BuildKit
79
+ uses : docker/setup-buildx-action@v1
80
+ with :
81
+ install : true
82
+
78
83
- name : Set up Node
79
84
uses : actions/setup-node@v2
80
85
with :
81
86
node-version : " 15.14"
87
+ cache : " yarn"
88
+ cache-dependency-path : ./webapp/yarn.lock
82
89
83
90
- name : Install web app
84
91
working-directory : ./webapp
@@ -92,21 +99,24 @@ jobs:
92
99
working-directory : ./webapp
93
100
run : yarn build
94
101
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
103
108
104
109
- 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
105
114
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
109
118
110
119
- name : Run end-to-end tests
111
120
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