Skip to content

v2.0.1

v2.0.1 #20

Workflow file for this run

---
name: 'Publish'
on:
release:
types: ['published']
jobs:
publish:
name: 'Publish'
runs-on: 'ubuntu-22.04'
steps:
- name: 'Checkout the codebase'
uses: 'actions/checkout@v4'
- name: 'Set up Python 3'
uses: 'actions/setup-python@v5'
with:
python-version: '3.x'
- name: 'Install ansible-core package'
run: pip3 install ansible-core
- name: 'Get an Ansible role name'
id: 'get_role_name'
run: echo "ROLE_NAME=$(yq '.galaxy_info.role_name' meta/main.yml)" >> $GITHUB_OUTPUT
- name: 'Publish the role to the Ansible Galaxy'
run: >-
ansible-galaxy role import \
--api-key ${{ secrets.GALAXY_API_KEY }} \
--role-name ${{ steps.get_role_name.outputs.ROLE_NAME }} \
$(echo $GITHUB_REPOSITORY | cut -d/ -f1) $(echo $GITHUB_REPOSITORY | cut -d/ -f2)