refactor: move more into the ci:deploy
task
This commit is contained in:
parent
24caeae329
commit
423e21f6c3
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
|
@ -204,20 +204,13 @@ jobs:
|
||||||
path: tools/deployment/.roles
|
path: tools/deployment/.roles
|
||||||
key: dependencies-composer-${{ hashFiles('tools/deployment/requirements.yml') }}
|
key: dependencies-composer-${{ hashFiles('tools/deployment/requirements.yml') }}
|
||||||
|
|
||||||
- name: Download Ansible roles
|
|
||||||
run: ansible-galaxy install -r tools/deployment/requirements.yml
|
|
||||||
|
|
||||||
- name: Export the Ansible Vault password
|
- name: Export the Ansible Vault password
|
||||||
run: echo $ANSIBLE_VAULT_PASS > tools/deployment/.vault-pass.txt
|
run: echo $ANSIBLE_VAULT_PASS > tools/deployment/.vault-pass.txt
|
||||||
env:
|
env:
|
||||||
ANSIBLE_VAULT_PASS: ${{ secrets.ANSIBLE_VAULT_PASS }}
|
ANSIBLE_VAULT_PASS: ${{ secrets.ANSIBLE_VAULT_PASS }}
|
||||||
|
|
||||||
- name: Deploy the code
|
- name: Deploy the code
|
||||||
run: >
|
run: ./run ci:deploy
|
||||||
ansible-playbook tools/deployment/deploy.yml
|
|
||||||
-i tools/deployment/hosts.yml
|
|
||||||
-e "ansistrano_deploy_branch=$GITHUB_SHA"
|
|
||||||
--vault-password-file=tools/deployment/.vault-pass.txt
|
|
||||||
|
|
||||||
- name: Remove the Ansible Vault password file
|
- name: Remove the Ansible Vault password file
|
||||||
run: rm tools/deployment/.vault-pass.txt
|
run: rm tools/deployment/.vault-pass.txt
|
||||||
|
|
4
run
4
run
|
@ -17,8 +17,12 @@ function task:ci:build {
|
||||||
}
|
}
|
||||||
|
|
||||||
function task:ci:deploy {
|
function task:ci:deploy {
|
||||||
|
ansible-galaxy install -r tools/deployment/requirements.yml
|
||||||
|
|
||||||
ansible-playbook tools/deployment/deploy.yml \
|
ansible-playbook tools/deployment/deploy.yml \
|
||||||
|
-e "ansistrano_deploy_branch=${1:-production}" \
|
||||||
-i tools/deployment/hosts.yml \
|
-i tools/deployment/hosts.yml \
|
||||||
|
--vault-password-file="${2:-tools/deployment/.vault-pass.txt}" \
|
||||||
"${@}"
|
"${@}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue