v1.7.0 #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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) |