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