From 423e21f6c3a81195ef12cca416e89c71a6b53b57 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 9 Dec 2021 22:24:11 +0000 Subject: [PATCH] refactor: move more into the `ci:deploy` task --- .github/workflows/ci.yml | 9 +-------- run | 4 ++++ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac5477b..f1a482c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -204,20 +204,13 @@ jobs: path: tools/deployment/.roles 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 run: echo $ANSIBLE_VAULT_PASS > tools/deployment/.vault-pass.txt env: ANSIBLE_VAULT_PASS: ${{ secrets.ANSIBLE_VAULT_PASS }} - name: Deploy the code - run: > - 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 + run: ./run ci:deploy - name: Remove the Ansible Vault password file run: rm tools/deployment/.vault-pass.txt diff --git a/run b/run index 65d427d..00c0d53 100755 --- a/run +++ b/run @@ -17,8 +17,12 @@ function task:ci:build { } function task:ci:deploy { + ansible-galaxy install -r tools/deployment/requirements.yml + ansible-playbook tools/deployment/deploy.yml \ + -e "ansistrano_deploy_branch=${1:-production}" \ -i tools/deployment/hosts.yml \ + --vault-password-file="${2:-tools/deployment/.vault-pass.txt}" \ "${@}" }