Skip to content

Commit 90e9b75

Browse files
committedDec 6, 2024
fix cd
1 parent 4868c8e commit 90e9b75

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed
 

‎.forgejo/workflows/ansibleCD.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ jobs:
110110
fb62a8d1-6dd5-4fab-aff4-b23e0021e215 > npm_host
111111
90a16954-45df-49ad-9f45-b23e002273c5 > runner_host
112112
a5b6fa4b-4643-4f85-988b-b23e00245e2f > ubu_host
113+
26b06759-9791-42d7-a076-b23e0063c4dd > ssh_private_key
113114
114115
115116
- name: Create hosts.ini file
@@ -128,11 +129,21 @@ jobs:
128129
ubu.lan ansible_host=${{ steps.bitwarden-secrets.outputs.ubu_host }} ansible_user=mafyuh
129130
EOF
130131
132+
- name: Create Private key
133+
run: |
134+
cat <<EOF > /root/.ssh/id_rsa
135+
${{ steps.bitwarden-secrets.outputs.ssh_private_key }}
136+
EOF
137+
138+
- name: Set permissions for private key
139+
run: |
140+
chmod 600 /root/.ssh/id_rsa
141+
142+
131143
- name: Run Ansible Playbook
132144
uses: docker://mafyuh/ansible-bws:v1.0.4
133145
with:
134146
args: ansible-playbook -i ansible/hosts.ini ./ansible/playbooks/deploy-docker.yml --extra-vars "target_host=${{ env.target_host }} folder=${{ env.folder }}"
135147
env:
136148
BWS_ACCESS_TOKEN: ${{ secrets.BWS_ACCESS_TOKEN }}
137-
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
138149
ANSIBLE_CONFIG: ansible/ansible.cfg

0 commit comments

Comments
 (0)
Please sign in to comment.