-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (30 loc) · 1.08 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Dry Run Deployment
on: [push]
jobs:
dry-run-deployment:
name: Dry Run Deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Override environment variables
run: |
echo 'VITE_API_ROOT=http://127.0.0.1:8080/' >> .env.production
echo 'VITE_MEDIA_ROOT=http://127.0.0.1:8080/' >> .env.production
echo "MEDIA=$GITHUB_WORKSPACE" >> .env.production
- name: Deploy to Docker containers on localhost
run: |
bash ./build_and_run.sh .env.production
- name: Integration test
run: |
set -x
TRIES=0
while [[ -z "${DIR_LIST:-}" ]] && [[ "$TRIES" -le 120 ]]
do
DIR_LIST=$(curl 'http://127.0.0.1:8080/?dir=' || true)
((++TRIES))
sleep 0.5
done
grep '{"name":".gitignore","type":"file","url":"/.gitignore"}' <<< "$DIR_LIST"
grep '{"name":"backend","type":"directory","url":"/backend"}' <<< "$DIR_LIST"
HTML=$(curl http://127.0.0.1/)
grep 'Pi Player' <<< "$HTML"