From 2d020f26d87b537cb93cef542a91f063c9fa2d00 Mon Sep 17 00:00:00 2001 From: Larry Smith Jr Date: Mon, 22 Nov 2021 14:16:03 -0500 Subject: [PATCH] Add Ansible Galaxy release workflow Fixes #75 --- .github/workflows/release-galaxy.yml | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/release-galaxy.yml diff --git a/.github/workflows/release-galaxy.yml b/.github/workflows/release-galaxy.yml new file mode 100644 index 0000000..b96555a --- /dev/null +++ b/.github/workflows/release-galaxy.yml @@ -0,0 +1,34 @@ +--- +name: Ansible Galaxy +on: + push: + branches: + - main + - master + release: + types: + - published + +jobs: + galaxy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt -r requirements-dev.txt + - name: Trigger a new import on Galaxy. + run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2)