Ansible: Extract an include for building theme assets

This commit is contained in:
Oliver Davies 2020-06-17 01:36:06 +01:00
parent e874475c32
commit 9dbcf903f4
2 changed files with 27 additions and 22 deletions

View file

@ -0,0 +1,26 @@
---
- name: Export body values to include in theme purging
command: >
{{ release_drush_path }} opdavies:export-body-values-for-theme-purging
chdir={{ release_theme_path }}
creates={{ release_theme_path }}/body-field-values.txt
- name: Install theme dependencies
command: >
npm install
chdir={{ release_theme_path }}
creates={{ release_theme_path }}/node_modules
- name: Generate front-end assets
command: >
npm run production
chdir={{ release_theme_path }}
creates={{ release_theme_path }}/dist
- name: Remove files that are no longer needed
file:
path: "{{ release_theme_path }}/{{ item }}"
state: absent
with_items:
- body-field-values.txt
- node_modules