ci: fix galaxy publish to trigger only on release, simplify deps

This commit is contained in:
Larry Smith Jr.
2026-04-08 09:59:45 -04:00
parent 12f7033566
commit 454649d90b
+15 -19
View File
@@ -1,10 +1,6 @@
---
name: Ansible Galaxy
on:
push:
branches:
- main
- master
release:
types:
- published
@@ -14,21 +10,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python 3.9
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
python-version: '3.11'
- name: Install Ansible
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt
- name: Trigger a new import on Galaxy.
run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2)
pip install ansible-core
- name: Trigger a new import on Galaxy
run: >-
ansible-galaxy role import
--api-key ${{ secrets.GALAXY_API_KEY }}
${{ github.repository_owner }}
${{ github.event.repository.name }}