@@ -19,84 +19,73 @@ jobs:
19
19
PLATFORMSH_CLI_NO_INTERACTION : 1
20
20
PLATFORMSH_CLI_TOKEN : ${{ secrets.PLATFORMSH_CLI_TOKEN }}
21
21
steps :
22
-
23
- - uses : actions/checkout@v4
22
+ - name : Clone frontend
23
+ uses : actions/checkout@v4
24
24
with :
25
25
repository : nationalarchives/ds-etna-frontend
26
26
path : frontend
27
- - uses : actions/checkout@v4
27
+ - name : Clone CMS
28
+ uses : actions/checkout@v4
28
29
with :
29
30
repository : nationalarchives/ds-wagtail
30
31
path : cms
31
- - uses : actions/checkout@v4
32
+ - name : Clone search API
33
+ uses : actions/checkout@v4
32
34
with :
33
35
repository : nationalarchives/ds-etna-search
34
36
path : search
35
-
36
37
- name : Install Platform.sh CLI
37
38
run : |
38
- cd cms
39
39
curl -fsSL https://raw.githubusercontent.com/platformsh/cli/main/installer.sh | bash
40
40
platform
41
+ - name : Get DB dump
42
+ run : |
43
+ cd cms
41
44
platform db:dump -p $PLATFORM_PROJECT_ID -e $PLATFORM_BRANCH -f dump.psql
42
-
43
-
44
45
- name : Start DB
45
46
run : |
46
47
cd cms
47
48
touch .env
48
49
docker compose up db -d
49
-
50
-
51
50
- name : Migrate DB
52
51
run : |
53
52
cd cms
54
53
ls -alh
55
- cat dump.psql
56
54
docker compose exec db psql -d $DATABASE_NAME -U $DATABASE_USER < dump.psql
57
-
58
- platform mount:download -e $PLATFORM_BRANCH -p $PLATFORM_PROJECT_ID -m media --target=media --exclude='/images/*' --yes
59
-
60
55
- name : Migrate media
61
56
run : |
62
57
cd cms
63
58
platform mount:download -e $PLATFORM_BRANCH -p $PLATFORM_PROJECT_ID -m media --target=media --exclude='/images/*' --yes
64
59
docker compose up cli
65
60
docker compose exec cli chmod -fR 777 media
66
61
docker compose stop cli
67
-
68
62
- name : Start CMS
69
63
run : |
70
64
cd cms
71
65
docker compose up web -d
72
-
73
66
- name : Start frontend
74
67
run : |
75
68
cd frontend
76
69
docker compose up app -d
77
- - uses : nev7n/wait_for_response@v1
78
- with :
79
- url : http://localhost:65535/healthcheck/live/
80
- - name : Check
81
- run : >
82
- curl --silent http://localhost:65535/browse/ | grep '<h1 class="tna-heading-xl">Explore 1,000 years of history</h1>'
83
-
84
- - uses : nev7n/wait_for_response@v1
85
- with :
86
- url : http://localhost:8000/healthcheck/live/
87
-
88
-
89
-
90
- # - name: Check
91
- # run: >
92
- # curl --silent http://localhost:65535/ | grep 'something'
93
70
- name : Start search
94
71
run : |
95
72
cd search
96
73
docker compose up app -d
97
- - uses : nev7n/wait_for_response@v1
74
+ - name : Wait for frontend
75
+ uses : nev7n/wait_for_response@v1
76
+ with :
77
+ url : http://localhost:65535/healthcheck/live/
78
+ - name : Wait for CMS
79
+ uses : nev7n/wait_for_response@v1
80
+ with :
81
+ url : http://localhost:8000/healthcheck/live/
82
+ - name : Wait for search API
83
+ uses : nev7n/wait_for_response@v1
98
84
with :
99
85
url : http://localhost:65534/healthcheck/live/
100
- - name : Check
86
+ - name : Check frontend
87
+ run : >
88
+ curl --silent http://localhost:65535/browse/ | grep '<h1 class="tna-heading-xl">Explore 1,000 years of history</h1>'
89
+ - name : Check frontend with CMS
101
90
run : >
102
91
curl --silent http://localhost:65534/docs | grep '<title>ETNA Search API - Swagger UI</title>'
0 commit comments