Skip to content

robertdebock/galaxy-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Galaxy action

A GitHub action to publish your Ansible role to Galaxy.

Requirements

This action expects the following (default Ansible role) structure:

.
├── defaults
│   └── main.yml
├── handlers
│   └── main.yml
├── meta
│   └── main.yml
├── requirements.yml
├── tasks
│   └── main.yml
└── vars
    └── main.yml

Inputs

galaxy_api_key

The API Key for your personal Galaxy account. Found under https://galaxy.ansible.com/me/preferences . You can store this key in GitHub's Settings -> Secrets -> New repository secret. (Name: galaxy_api_key, Value: The token you copied from Galaxy.)

path

For repositories that have multiple roles, you can specify a (relative) path to go into before releasing the role. Defaults to ./. An example value could be my_role.

git_branch

You may specify a specific branch to push. The default is master.

Example usage

---
name: GitHub Action

on:
  - push

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v2
      - name: galaxy
        uses: robertdebock/[email protected]
        with:
          galaxy_api_key: ${{ secrets.galaxy_api_key }}

Here is a another example that uses molecule to test the role and this Galaxy action to release:

name: GitHub Action

on:
  - push

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v2
        with:
          path: "${{ github.repository }}"
      - name: molecule
        uses: robertdebock/[email protected]
  release:
    needs:
      - test
    runs-on: ubuntu-latest
    steps:
      - name: galaxy
        uses: robertdebock/[email protected]
        with:
          galaxy_api_key: ${{ secrets.galaxy_api_key }}

When you have multiple roles in your repository, you can release one specific role by specifying a path:

---
name: GitHub Action

on:
  - push

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v2
      - name: galaxy
        uses: robertdebock/[email protected]
        with:
          galaxy_api_key: ${{ secrets.galaxy_api_key }}
          path: my_role
          git_branch: my_branch