-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (47 loc) · 1.57 KB
/
deploy.yml
File metadata and controls
56 lines (47 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Deploy mockdata.dev
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout bruno-ansible repository
uses: actions/checkout@v4
with:
repository: teambruno/bruno-ansible
token: ${{ secrets.GH_TOKEN }}
ref: main
path: bruno-ansible
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install Ansible
run: |
sudo apt update
sudo apt-add-repository ppa:ansible/ansible -y
sudo apt update
sudo apt install ansible-core -y
- name: Install Ansible Collections
run: |
ansible-galaxy collection install community.general
ansible-galaxy collection install community.docker:3.10.2
- name: Create Vault Password File
env:
VAULT_PASSWORD: ${{ secrets.ANSIBLE_VAULT_PASSWORD }}
run: |
echo "$VAULT_PASSWORD" > vault_pass.txt
working-directory: bruno-ansible
- name: Setup SSH Key
env:
SSH_PRIVATE_KEY: ${{ secrets.HOST_SSH_PRIVATE_KEY }}
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H 54.89.154.153 >> ~/.ssh/known_hosts
chmod 600 ~/.ssh/known_hosts
- name: Run Ansible Playbook
run: |
ansible-playbook playbooks/bruno-mockdata-server.yml --vault-password-file vault_pass.txt --tags "deploy"
working-directory: bruno-ansible