Add Galaxy role import to Actions #16
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: Linter the project | ||
on: [push] | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: quay.io/mmul/kpa | ||
options: --user root | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Check with yamllint | ||
run: yamllint collections/ defaults/ handlers/ meta/ tasks/ tests/ | ||
- name: Check with ansible-lint | ||
run: ansible-lint tests/kubelab.yml | ||
- name: Install role dependencies | ||
run: ansible-galaxy install -r collections/requirements.yml | ||
- name: Check with ansible-playbook --syntax-check | ||
run: ansible-playbook --syntax-check tests/kubelab.yml | ||
trigger_galaxy_import: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
container: | ||
image: ghcr.io/mmul-it/kpa | ||
options: --user root | ||
if: github.ref == 'refs/heads/main' | ||
steps: | ||
- name: Trigger Ansible Galaxy to import the role | ||
run: ansible-galaxy role import --token ${{ secrets.GALAXY_API_KEY }} ${{ github.repository_owner }} ${{ github.event.repository.name }} |