diff --git a/.github/actions/deploy-common/action.yaml b/.github/actions/deploy-common/action.yaml index a94d8eb..09483e5 100644 --- a/.github/actions/deploy-common/action.yaml +++ b/.github/actions/deploy-common/action.yaml @@ -11,9 +11,26 @@ inputs: runs: using: 'composite' steps: - - name: Test Ansible + - name: Create SSH key shell: bash - run: ansible-playbook --help -# - -# run: echo ${{ inputs.destination }} -# shell: bash + run: | + install -m 600 -D /dev/null ~/.ssh/id_rsa + echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa + echo "${{ secrets.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts + ssh ${{ inputs.destination }} hostname -f + + - name: Pick secret.yml + shell: bash + run: cp group_var/secret-${{ inputs.destination }}.yml group_var/secret.yml + + - name: Install requirements + shell: bash + run: ansible-galaxy install -p roles -r requirements.yml + + - name: Vault password + shell: bash + run: echo "${{ secrets.VAULT_PASSWORD }}" >.vault-password.txt + + - name: Run playbook + shell: bash + run ansible-playbook diff --git a/.github/workflows/deploy-test.yaml b/.github/workflows/deploy-test.yaml index 457b2e1..99cf96b 100644 --- a/.github/workflows/deploy-test.yaml +++ b/.github/workflows/deploy-test.yaml @@ -13,6 +13,6 @@ jobs: - name: Call common uses: ./.github/actions/deploy-common with: - destination: 'usegalaxy-test.blablabla' + destination: 'usegalaxy-test.cerit-sc.cz' diff --git a/group_vars/secret.yml b/group_vars/secret-usegalaxy.cerit-sc.cz.yml similarity index 100% rename from group_vars/secret.yml rename to group_vars/secret-usegalaxy.cerit-sc.cz.yml