mirror of
https://github.com/mrlesmithjr/ansible-manage-lvm.git
synced 2026-05-25 22:27:23 +03:00
ci: fix galaxy publish to trigger only on release, simplify deps
This commit is contained in:
@@ -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 }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user