Skip to content

Instantly share code, notes, and snippets.

@yyandrew
Last active November 3, 2023 23:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yyandrew/c49472d3244194527f53ff605786d81d to your computer and use it in GitHub Desktop.
Save yyandrew/c49472d3244194527f53ff605786d81d to your computer and use it in GitHub Desktop.
Scripts to deploy react app by ansistrano
# .ansistrano/build.yml
- shell: cd "{{ ansistrano_deploy_to }}/current" && npm install
- shell: cd "{{ ansistrano_deploy_to }}/current" && npm run build
- shell: sudo chgrp -R nginx "{{ ansistrano_deploy_to }}/current/"
#!/bin/bash
ansible-playbook -i .ansistrano/hosts/vagrant-vm .ansistrano/deploy.yml
# .ansistrano/deploy.yml
---
- name: Deploy react-boilerplate
hosts: all
vars:
ansistrano_deploy_from: "{{ playbook_dir }}"
ansistrano_deploy_to: "/var/www/react-boilerplate"
ansistrano_git_repo: git@github.com:yyandrew/react-boilerplate.git
ansistrano_git_branch: "master"
ansistrano_keep_releases: 0
ansistrano_deploy_via: "git"
ansistrano_after_symlink_tasks_file: 'build.yml'
ansistrano_git_identity_key_remote_path: ''
roles:
- { role: ansistrano.deploy }
/*.ansistrano/hosts/vagrant-vm*/
web01 ansible_user=vagrant ansible_port=2222 ansible_host=127.0.0.1 ansible_ssh_private_key_file=/Users/andrew/.vagrant.d/insecure_private_key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment