Skip to content

Commit 2727d1f

Browse files
authoredFeb 24, 2025
Create ansible-publish.yml
1 parent c2f38dd commit 2727d1f

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
 

‎.github/workflows/ansible-publish.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish Collection to Ansible Galaxy
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out repository
12+
uses: actions/checkout@v3
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.x'
18+
19+
- name: Install Ansible and dependencies
20+
run: |
21+
pip install ansible ansible-lint
22+
23+
- name: Build Ansible Collection
24+
run: |
25+
ansible-galaxy collection build --output-path ./dist
26+
27+
- name: Publish Collection
28+
env:
29+
ANSIBLE_GALAXY_API_KEY: ${{ secrets.ANSIBLE_GALAXY_API_KEY }}
30+
run: |
31+
ansible-galaxy collection publish dist/*.tar.gz --api-key "$ANSIBLE_GALAXY_API_KEY"

0 commit comments

Comments
 (0)