Skip to content

Instantly share code, notes, and snippets.

@mitchgu
Created July 10, 2016 00:08
Show Gist options
  • Save mitchgu/4bb36769ff8ba5013ed51f05830bdca4 to your computer and use it in GitHub Desktop.
Save mitchgu/4bb36769ff8ba5013ed51f05830bdca4 to your computer and use it in GitHub Desktop.
Ansible static site deploy
---
- 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