Skip to content

Commit fc75be7

Browse files
committed
Example test workflow
1 parent 13d894f commit fc75be7

File tree

1 file changed

+23
-34
lines changed

1 file changed

+23
-34
lines changed

.github/workflows/deploy-develop.yml

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,84 +19,73 @@ jobs:
1919
PLATFORMSH_CLI_NO_INTERACTION: 1
2020
PLATFORMSH_CLI_TOKEN: ${{ secrets.PLATFORMSH_CLI_TOKEN }}
2121
steps:
22-
23-
- uses: actions/checkout@v4
22+
- name: Clone frontend
23+
uses: actions/checkout@v4
2424
with:
2525
repository: nationalarchives/ds-etna-frontend
2626
path: frontend
27-
- uses: actions/checkout@v4
27+
- name: Clone CMS
28+
uses: actions/checkout@v4
2829
with:
2930
repository: nationalarchives/ds-wagtail
3031
path: cms
31-
- uses: actions/checkout@v4
32+
- name: Clone search API
33+
uses: actions/checkout@v4
3234
with:
3335
repository: nationalarchives/ds-etna-search
3436
path: search
35-
3637
- name: Install Platform.sh CLI
3738
run: |
38-
cd cms
3939
curl -fsSL https://raw.githubusercontent.com/platformsh/cli/main/installer.sh | bash
4040
platform
41+
- name: Get DB dump
42+
run: |
43+
cd cms
4144
platform db:dump -p $PLATFORM_PROJECT_ID -e $PLATFORM_BRANCH -f dump.psql
42-
43-
4445
- name: Start DB
4546
run: |
4647
cd cms
4748
touch .env
4849
docker compose up db -d
49-
50-
5150
- name: Migrate DB
5251
run: |
5352
cd cms
5453
ls -alh
55-
cat dump.psql
5654
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-
6055
- name: Migrate media
6156
run: |
6257
cd cms
6358
platform mount:download -e $PLATFORM_BRANCH -p $PLATFORM_PROJECT_ID -m media --target=media --exclude='/images/*' --yes
6459
docker compose up cli
6560
docker compose exec cli chmod -fR 777 media
6661
docker compose stop cli
67-
6862
- name: Start CMS
6963
run: |
7064
cd cms
7165
docker compose up web -d
72-
7366
- name: Start frontend
7467
run: |
7568
cd frontend
7669
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'
9370
- name: Start search
9471
run: |
9572
cd search
9673
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
9884
with:
9985
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
10190
run: >
10291
curl --silent http://localhost:65534/docs | grep '<title>ETNA Search API - Swagger UI</title>'

0 commit comments

Comments
 (0)