mirror of
https://github.com/mrlesmithjr/ansible-manage-lvm.git
synced 2026-09-08 00:18:15 +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
|
name: Ansible Galaxy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- master
|
|
||||||
release:
|
release:
|
||||||
types:
|
types:
|
||||||
- published
|
- published
|
||||||
@@ -14,21 +10,21 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
submodules: recursive
|
- name: Set up Python
|
||||||
- name: Set up Python 3.9
|
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.9'
|
python-version: '3.11'
|
||||||
- uses: actions/cache@v4
|
|
||||||
with:
|
- name: Install Ansible
|
||||||
path: ~/.cache/pip
|
|
||||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pip-
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install -r requirements.txt -r requirements-dev.txt
|
pip install ansible-core
|
||||||
- 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)
|
- 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