This commit is contained in:
Oliver Davies 2020-12-12 21:00:36 +00:00
parent 2fb52df7c8
commit 58210e255f

View file

@ -20,36 +20,38 @@ jobs:
ANSIBLE_HOST_KEY_CHECKING: no
steps:
- name: Checkout the code
uses: actions/checkout@a81bbbf
- run: ansible --version
- name: Add the deployment SSH key
uses: shimataro/ssh-key-action@6f350ca
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
name: id_rsa
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
# - name: Checkout the code
# uses: actions/checkout@a81bbbf
- name: Cache dependencies
uses: actions/cache@d974700
with:
path: tools/ansible/.roles
key: dependencies-composer-${{ hashFiles('tools/ansible/requirements.yml') }}
# - name: Add the deployment SSH key
# uses: shimataro/ssh-key-action@6f350ca
# with:
# key: ${{ secrets.SSH_PRIVATE_KEY }}
# name: id_rsa
# known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
- name: Download Ansible roles
run: ansible-galaxy install -r tools/ansible/requirements.yml
# - name: Cache dependencies
# uses: actions/cache@d974700
# with:
# path: tools/ansible/.roles
# key: dependencies-composer-${{ hashFiles('tools/ansible/requirements.yml') }}
- name: Export the Ansible Vault password
run: echo $ANSIBLE_VAULT_PASS > tools/ansible/.vault-pass.txt
env:
ANSIBLE_VAULT_PASS: ${{ secrets.ANSIBLE_VAULT_PASS }}
# - name: Download Ansible roles
# run: ansible-galaxy install -r tools/ansible/requirements.yml
- name: Deploy the code
run: >
ansible-playbook tools/ansible/deploy.yml
-i tools/ansible/hosts.yml
-e "ansistrano_deploy_branch=$GITHUB_SHA"
--vault-password-file=tools/ansible/.vault-pass.txt
# - name: Export the Ansible Vault password
# run: echo $ANSIBLE_VAULT_PASS > tools/ansible/.vault-pass.txt
# env:
# ANSIBLE_VAULT_PASS: ${{ secrets.ANSIBLE_VAULT_PASS }}
- name: Remove the Ansible Vault password file
run: rm tools/ansible/.vault-pass.txt
# - name: Deploy the code
# run: >
# ansible-playbook tools/ansible/deploy.yml
# -i tools/ansible/hosts.yml
# -e "ansistrano_deploy_branch=$GITHUB_SHA"
# --vault-password-file=tools/ansible/.vault-pass.txt
# - name: Remove the Ansible Vault password file
# run: rm tools/ansible/.vault-pass.txt