diff --git a/tools/ansible/deploy/after-update-code.yml b/tools/ansible/deploy/after-update-code.yml index f03c31c..a12c189 100644 --- a/tools/ansible/deploy/after-update-code.yml +++ b/tools/ansible/deploy/after-update-code.yml @@ -4,6 +4,23 @@ command: install working_dir: '{{ ansistrano_release_path.stdout }}' +- name: Generate front-end assets + command: | + {{ item.command }} + chdir={{ release_theme_path }} + creates="{{ item.creates }}" + with_items: + - command: npm install + creates: "{{ release_theme_path }}/node_modules" + + - command: npm run production + creates: "{{ release_theme_path }}/dist" + +- name: Remove node_modules as they are no longer needed + file: + path: "{{ release_theme_path }}/node_modules" + state: absent + - name: Generate settings.php file include_role: name: opdavies.drupal_settings_files diff --git a/tools/ansible/vars/deploy_vars.yml b/tools/ansible/vars/deploy_vars.yml index 1f25fd0..c899a1b 100644 --- a/tools/ansible/vars/deploy_vars.yml +++ b/tools/ansible/vars/deploy_vars.yml @@ -17,6 +17,7 @@ app_hash_salt: '{{ vault_app_hash_salt }}' release_drush_path: '{{ ansistrano_release_path.stdout }}/vendor/bin/drush' release_web_path: '{{ ansistrano_release_path.stdout }}/{{ project_web_dir }}' +release_theme_path: '{{ release_web_path }}/themes/custom/opdavies' drupal_settings: - drupal_root: '{{ release_web_path }}'