diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index e52a1e4..86113b7 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -104,4 +104,4 @@ jobs: SSH_KEY: ${{ secrets.SSH_KEY }} run: | cd deployment - ./configure.sh "$SSH_KEY" "${{ steps.public_ip.outputs.stdout }}" + ./configure.sh "$SSH_KEY" "${{ steps.public_ip.outputs.stdout }}" "{{ github.sha }}" diff --git a/deployment/configure.sh b/deployment/configure.sh index 27d081d..416dda6 100755 --- a/deployment/configure.sh +++ b/deployment/configure.sh @@ -4,6 +4,7 @@ set -e SSH_KEY="$1" IP="$2" +GIT_REF="$3" # Prepare the ansible setup cat > inventory.yaml << EOF @@ -13,6 +14,7 @@ all: ansible_user: egi ansible_ssh_private_key_file: key ansible_ssh_common_args: -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null + git_ref: $GIT_REF EOF echo "$SSH_KEY" > key diff --git a/deployment/playbook.yaml b/deployment/playbook.yaml index e525152..d50ebad 100644 --- a/deployment/playbook.yaml +++ b/deployment/playbook.yaml @@ -18,11 +18,11 @@ become: yes gather_facts: yes tasks: - - name: Get dashboard repo + - name: Checkout repo at VM ansible.builtin.git: - repo: 'https://github.com/enolfc/horizon-aggregator.git' + repo: 'https://github.com/EGI-Foundation/fedcloud-dashboard.git' + version: {{ git_ref }} dest: /horizon-aggregator - version: gunicorn - name: env file ansible.builtin.copy: