-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (53 loc) · 1.74 KB
/
deploy-infra.yml
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
61
62
name: Deploy site infra
on:
push:
branches:
- ovh/infra/production
workflow_dispatch:
inputs:
tags:
description: 'Tags to specify which parts of the playbook to run'
required: false
default: ''
schedule:
- cron: '0 6 * * *'
concurrency:
group: deploy-infra-ovh
cancel-in-progress: false
env:
ANSIBLE_FORCE_COLOR: true
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'pip'
- name: Save ansible private key to file
run: |
mkdir -p infra/keys/ansible
echo "${{ secrets.ANSIBLE_SSH_PRIVATE_KEY }}" > infra/keys/ansible/id_ed25519
chmod 600 infra/keys/ansible/id_ed25519
ssh-keygen -y -f infra/keys/ansible/id_ed25519 > infra/keys/ansible/id_ed25519.pub
- name: Install python3 deps
run: pip3 install -r requirements.txt
working-directory: infra
- name: Run ansible galaxy install
run: ansible-galaxy install -r ./requirements.yml
working-directory: infra
- name: Run configure playbook
working-directory: infra
run: |
if [ -n "${{ github.event.inputs.tags }}" ]; then
ansible-playbook ./configure.yml --tags "${{ github.event.inputs.tags }}"
else
ansible-playbook ./configure.yml
fi
env:
PODMAN_REGISTRY_USERNAME: ${{ secrets.PRODUCTION_PODMAN_REGISTRY_USERNAME }}
PODMAN_REGISTRY_PASSWORD: ${{ secrets.PRODUCTION_PODMAN_REGISTRY_PASSWORD }}
RAILS_MASTER_KEY: ${{ secrets.PRODUCTION_RAILS_MASTER_KEY }}