omnidoes / topperstation

MIT License
0 stars 0 forks source link

Configure CI to compile theme assets. #80

Open aaronlsilber opened 5 years ago

aaronlsilber commented 5 years ago

The Topperstation theme gitignores the compiled css directory with the intention of directing that responsibility to the CI workflow.

My knowledge of CI and devops is pretty lean, so this will be an adventure for me.

I asked the folks on the Pantheon community Slack where to start and they pointed me at this issue; https://github.com/pantheon-systems/docker-build-tools-ci/issues/26

Looks promising.

aaronlsilber commented 5 years ago

This Pantheon Orb documentation shows sass compilation as a build step. https://github.com/pantheon-systems/circleci-orb

I haven't checked yet, but I think one of our issues may be related to our gitignore.

from their docs...

        pre-steps:
          # Perform a git checkout of the code from GitHub/Bitbucket so that
          # custom commands (the rm below) can alter the code before it is
          # pushed to Pantheon.
          - checkout
          # Attach this dist directory created in npmbuild_and_persist
          # which contains the compiled css.
          - attach_workspace:
              at: .
          # The dist directory that holds the compiled Sass is git ignored.
          # It needs to be committed on Pantheon.
          # Removing this .gitignore file makes it available for committing.
          # Pantheon's Composer examples use a more complicated
          # technique of "cutting" the top level .gitignore
          # file so that lines specifying build artifact directories are removed.
          # https://github.com/pantheon-systems/example-drops-8-composer/blob/670ae310c601dabbb7b35411ff3e08e4b1fac7a3/composer.json#L67
          - run: rm wp-content/themes/may2019/.gitignore
ataylorme commented 5 years ago

I run a Node-based CI build step to compile theme assets on my personal site. You can check out the code at https://github.com/ataylorme/ataylorme-wordpress.

The Node build bash script and build_node CircleCI job will probably be the most helpful.