-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 1.12 KB
/
publish.yaml
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
# terraform managed
---
# Inspired on robertdebock (https://github.com/robertdebock) publish workflow
name: Release main or releases to Ansible Galaxy
on:
push:
branches:
- main
release:
types: [created, edited, published, released]
jobs:
publish:
runs-on: ubuntu-latest
env:
# allows molecule colors to be passed to GitHub Actions
PY_COLORS: 1
# allows ansible colors to be passed to GitHub Actions
ANSIBLE_FORCE_COLOR: 1
steps:
- name: checkout
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: |
deploy_requirements.txt
- name: Install dependencies
run: |
pip3 install --upgrade pip
pip3 install -r deploy_requirements.txt
- name: Publish role to galaxy
run: |
# repository is name/repo turn into -> name<SPACE>repo
ansible-galaxy role import --api-key ${{secrets.ANSIBLE_GALAXY_API_KEY}} $(echo "${{ github.repository }}" | sed 's!/! !g')