Skip to content

Commit

Permalink
fix(web): update volume on deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
akorzunin committed Aug 2, 2024
1 parent b9a718e commit 2317266
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
5 changes: 2 additions & 3 deletions deploy/dev/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
redir /download /download/
handle_path /download/* {
root * /srv/build
file_server {
file_server {
browse ./template.html
hide web frontend
hide frontend
}

}
root * /srv/dist
file_server
Expand Down
2 changes: 1 addition & 1 deletion deploy/dev/Caddyfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ supericosahedron.localhost {
root * build
file_server {
browse ./web/caddy_template/template.html
hide web frontend
hide frontend
}
}
reverse_proxy localhost:5173
Expand Down
2 changes: 1 addition & 1 deletion deploy/dev/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
image: ghcr.io/akorzunin/supericosahedron-frontend:latest
container_name: sepericosahedron-frontend-dev
volumes:
- frontend-dist-volume:/src/web/dist:ro
- frontend-dist-volume:/src/web/dist
command: ["tail", "-F", "aboba"]

volumes:
Expand Down
14 changes: 14 additions & 0 deletions deploy/dev/deploy_frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@
- Caddyfile
- compose.yaml

- name: Pull new frontend image
ansible.builtin.command:
cmd: docker compose pull
chdir: "{{ project_dir }}"
register: out
changed_when: out.rc != 0

- name: Remove old volume
ansible.builtin.command:
cmd: docker compose down -v
chdir: "{{ project_dir }}"
register: out
changed_when: out.rc != 0

- name: Deploy new image
ansible.builtin.command:
cmd: docker compose up -d --force-recreate
Expand Down

0 comments on commit 2317266

Please sign in to comment.