Skip to content

Commit 32de257

Browse files
committed
fix(ci): update Ansible Galaxy workflow to fix deprecation warnings
- Update actions/checkout from v3 to v4 - Update actions/setup-python from v4 to v5 - Remove deprecated actions/cache@v2 (no longer needed) - Update Python version from 3.9 to 3.11 - Remove unnecessary matrix strategy - Remove unnecessary dependencies (requirements.txt, pre-commit) - Change trigger to release-only (remove push to main/master) - Simplify workflow to use only ansible-core This fixes GitHub Actions deprecation warnings and simplifies the workflow to only publish to Galaxy when a GitHub release is created.
1 parent 83c1b1b commit 32de257

File tree

1 file changed

+17
-26
lines changed

1 file changed

+17
-26
lines changed
Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,29 @@
11
---
22
name: Ansible Galaxy
3+
34
on:
4-
push:
5-
branches:
6-
- main
7-
- master
85
release:
96
types:
107
- published
118

129
jobs:
1310
galaxy:
1411
runs-on: ubuntu-latest
15-
strategy:
16-
matrix:
17-
python-version: [3.9]
1812
steps:
19-
- uses: actions/checkout@v3
20-
with:
21-
submodules: recursive
22-
- name: Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@v4
24-
with:
25-
python-version: ${{ matrix.python-version }}
26-
- uses: actions/cache@v2
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
2718
with:
28-
path: ~/.cache/pip
29-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
30-
restore-keys: |
31-
${{ runner.os }}-pip-
32-
- name: Install dependencies
33-
run: |
34-
python -m pip install --upgrade pip
35-
pip install -r requirements.txt -r requirements-dev.txt
36-
pip install pre-commit
37-
- name: Trigger a new import on Galaxy.
38-
run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2)
19+
python-version: "3.11"
20+
21+
- name: Install Ansible
22+
run: pip install ansible-core
23+
24+
- name: Trigger Galaxy import
25+
run: >-
26+
ansible-galaxy role import
27+
--api-key ${{ secrets.GALAXY_API_KEY }}
28+
${{ github.repository_owner }}
29+
${{ github.event.repository.name }}

0 commit comments

Comments
 (0)