From 948caec79ce0a2843c5a335c21a2d037841ced68 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 30 Jan 2018 23:27:38 +0000 Subject: [PATCH] Generate site twice on deploy Generate the first time so that the output directories are created. Then when PurgeCSS runs, it can look at the generated files when purging the stylesheets. Generate again to copy the final assets from "source/build" to the correct output directory. There may be a better way, but this works for now. --- ansible/deploy/after-symlink-shared.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/ansible/deploy/after-symlink-shared.yml b/ansible/deploy/after-symlink-shared.yml index 26d79fbb..f85aaec1 100644 --- a/ansible/deploy/after-symlink-shared.yml +++ b/ansible/deploy/after-symlink-shared.yml @@ -1,4 +1,14 @@ --- +- name: Install Composer dependencies + composer: + command: install + working_dir: "{{ ansistrano_release_path.stdout }}" + +- name: Generate the site once without assets + command: composer run prod + args: + chdir: "{{ ansistrano_release_path.stdout }}" + - name: Install Node dependencies command: yarn install args: @@ -9,12 +19,7 @@ args: chdir: "{{ ansistrano_release_path.stdout }}" -- name: Install Composer dependencies - composer: - command: install - working_dir: "{{ ansistrano_release_path.stdout }}" - -- name: Generate the site +- name: Generate the site, including assets command: composer run prod args: chdir: "{{ ansistrano_release_path.stdout }}"