Created
July 10, 2016 00:08
-
-
Save mitchgu/4bb36769ff8ba5013ed51f05830bdca4 to your computer and use it in GitHub Desktop.
Ansible static site deploy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Build static site locally | |
hosts: localhost | |
gather_facts: no | |
connection: local | |
vars: | |
engine: middleman | |
tasks: | |
- name: Build middleman site | |
command: bundle exec middleman build | |
when: engine == "middleman" | |
tags: | |
- build | |
- name: Copy static site to host | |
hosts: all | |
gather_facts: no | |
vars: | |
name: PROJECT_NAME | |
build_dir: BUILD_DIR/ | |
ansible_ssh_user: ubuntu | |
tasks: | |
- name: Copy build directory | |
copy: | |
src: "{{ build_dir }}" | |
dest: /srv/{{name}} | |
become: yes | |
tags: | |
- copy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment