-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (49 loc) · 1.64 KB
/
startDevelopmentServer.yml
File metadata and controls
60 lines (49 loc) · 1.64 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
57
58
59
60
name: start development server
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Only run one ansible job at a time
concurrency: ansible
jobs:
run-scripts:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
pwd
python -m pip install --upgrade pip
pip install -r ./infrastructure/developmentServer/scripts/requirements.txt
- name: Start development server
env:
HETZNER_API_TOKEN: ${{ secrets.HETZNER_API_TOKEN }}
DEVELOPMENT_SERVER_SSH_PUBLIC_KEY: ${{secrets.DEVELOPMENT_SERVER_SSH_PUBLIC_KEY}}
run: python ./infrastructure/developmentServer/scripts/create_small_development_server.py
- name: Configure ssh
run: |
mkdir ~/.ssh
cat << EOF > ~/.ssh/config
Host *
User root
LogLevel ERROR
StrictHostKeyChecking accept-new
EOF
echo "${{ secrets.DEVELOPMENT_SERVER_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- name: Install ansible
run: |
pip install ansible ansible-lint passlib
# - name: Set up Ansible
# uses: ansible/ansible@v2.9.0
# with:
# ansible-version: '2.9.0'
- name: Install necessary dependencies
env:
DEVELOPMENT_SERVER_SSH_PUBLIC_KEY: ${{secrets.DEVELOPMENT_SERVER_SSH_PUBLIC_KEY}}
run: |
cd ./infrastructure/developmentServer/ansible ; ansible-playbook --user=root ./playbook.yml