From 5ae79ffa6e72fe990162aaecf50221aea7d4bc37 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 12 Aug 2020 00:46:08 +0100 Subject: [PATCH] Build talk slides during deploy --- slides/.gitkeep | 0 tools/ansible/deploy/after-update-code.yml | 1 + tools/ansible/includes/build-talk-slides.yml | 6 ++++++ tools/ansible/vars/provision_vars.yml | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 slides/.gitkeep create mode 100644 tools/ansible/includes/build-talk-slides.yml diff --git a/slides/.gitkeep b/slides/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tools/ansible/deploy/after-update-code.yml b/tools/ansible/deploy/after-update-code.yml index 9f1f679..a5f2f4a 100644 --- a/tools/ansible/deploy/after-update-code.yml +++ b/tools/ansible/deploy/after-update-code.yml @@ -32,3 +32,4 @@ changed_when: "'There are no changes to import' not in config_import_result.stderr" - include: ../includes/build-theme-assets.yml +- include: ../includes/build-talk-slides.yml diff --git a/tools/ansible/includes/build-talk-slides.yml b/tools/ansible/includes/build-talk-slides.yml new file mode 100644 index 0000000..c99921c --- /dev/null +++ b/tools/ansible/includes/build-talk-slides.yml @@ -0,0 +1,6 @@ +--- +- name: Generate static slides for talks + shell: > + npm install; npx reveal-md slides.md --static --static-dirs=assets + chdir={{ ansistrano_release_path.stdout }}/slides/{{ item }} + with_items: '{{ slides_repo_names }}' diff --git a/tools/ansible/vars/provision_vars.yml b/tools/ansible/vars/provision_vars.yml index efc3635..9b13a48 100644 --- a/tools/ansible/vars/provision_vars.yml +++ b/tools/ansible/vars/provision_vars.yml @@ -152,7 +152,7 @@ nginx_vhosts: # Talks {% for name in slides_repo_names %} location /slides-{{ name }} { - alias /srv/slides-{{ name }}/_static/; + alias {{ project_root_path }}/{{ ansistrano_current_dir }}/slides/{{ name }}/_static/; } {% endfor %}