Build theme CSS during deployment

Fixes #37
This commit is contained in:
Oliver Davies 2020-05-14 22:21:30 +01:00
parent 940db194ee
commit a2c1c99058
2 changed files with 18 additions and 0 deletions

View file

@ -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

View file

@ -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 }}'