File tree Expand file tree Collapse file tree 5 files changed +41
-9
lines changed
Expand file tree Collapse file tree 5 files changed +41
-9
lines changed Original file line number Diff line number Diff line change 2222 - name : Checkout code
2323 uses : actions/checkout@v4
2424
25- - name : Login to GitHub Container Registry
25+ - name : Install Ansible
26+ run : sudo apt-get update && sudo apt-get install -y ansible
27+
28+ - name : Validate Docker Compose config with Ansible
29+ env :
30+ IMAGE_TAG : dummy
31+ OPEN_WEBUI_API_KEY_CHAT : dummy_key
32+ OPEN_WEBUI_API_KEY_GEN : dummy_key
33+ LANGSMITH_API_KEY : dummy_key
34+ run : ansible-playbook ansible/validate-compose.yml
35+
36+ - name : Login to GitHub Container Registry # TODO: why? - remove?
2637 uses : docker/login-action@v3
2738 with :
2839 registry : ghcr.io
Original file line number Diff line number Diff line change 9191 OPEN_WEBUI_API_KEY_CHAT : ${{ secrets.OPEN_WEBUI_API_KEY_CHAT }}
9292 OPEN_WEBUI_API_KEY_GEN : ${{ secrets.OPEN_WEBUI_API_KEY_GEN }}
9393 LANGSMITH_API_KEY : ${{ secrets.LANGSMITH_API_KEY }}
94- run : ansible-playbook -i inventory.ini deploy/ ansible/deploy.yml
94+ run : ansible-playbook -i inventory.ini ansible/deploy.yml
9595
9696 deploy-k8s :
9797 needs : build-and-push
Original file line number Diff line number Diff line change 55
66 vars :
77 project_dir : /home/ubuntu/app
8- image_tag : " {{ lookup('env','IMAGE_TAG') }}"
9- open_webui_api_key_chat : " {{ lookup('env','OPEN_WEBUI_API_KEY_CHAT') }}"
10- open_webui_api_key_gen : " {{ lookup('env','OPEN_WEBUI_API_KEY_GEN') }}"
11- langsmith_api_key : " {{ lookup('env','LANGSMITH_API_KEY') }}"
128
139 tasks :
10+ - include_tasks : tasks/env_vars.yml # load env variables
11+
1412 - name : Ensure project directory exists
1513 file :
1614 path : " {{ project_dir }}"
1715 state : directory
1816
1917 - name : Template compose with image tags
2018 template :
21- src : ../../ docker-compose.yml.j2
19+ src : ../docker-compose.yml.j2
2220 dest : " {{ project_dir }}/docker-compose.yml"
2321
2422 - name : Copy Traefik configuration files
2523 copy :
26- src : ../../ traefik/
24+ src : ../traefik/
2725 dest : " {{ project_dir }}/traefik/"
2826
2927 - name : Create acme.json file for Let's Encrypt certificates
3634
3735 - name : Copy Prometheus configuration files
3836 copy :
39- src : ../../ monitoring/prometheus/
37+ src : ../monitoring/prometheus/
4038 dest : " {{ project_dir }}/monitoring/prometheus/"
4139
4240
Original file line number Diff line number Diff line change 1+ # validate_docker_compose.yaml
2+ - name : Validate Docker Compose Jinja template
3+ hosts : localhost
4+ gather_facts : false
5+
6+ tasks :
7+ - include_tasks : tasks/env_vars.yml # load env variables
8+
9+ - name : Template compose file
10+ template :
11+ src : ../docker-compose.yml.j2
12+ dest : /tmp/compose-validation.yaml
13+ mode : ' 0644'
14+
15+ - name : Validate Docker Compose config
16+ command : docker compose -f /tmp/compose-validation.yaml config
17+ register : result
18+ failed_when : result.rc != 0
19+
20+ - name : Delete temp file
21+ file :
22+ path : /tmp/compose-validation.yaml
23+ state : absent
You can’t perform that action at this time.
0 commit comments