refactor: Replace manual shadow gateway sync with unifi-on-boot ser…
#58
This file contains hidden or 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: CI | |
| 'on': | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out the codebase | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install lint dependencies | |
| run: pip3 install yamllint ansible-lint | |
| - name: Lint code with yamllint | |
| run: yamllint . | |
| - name: Lint code with ansible-lint | |
| run: ansible-lint | |
| molecule: | |
| name: Molecule | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - name: Check out the codebase | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install test dependencies | |
| run: pip3 install ansible molecule molecule-plugins[docker] | |
| - name: Run Molecule tests | |
| run: molecule test | |
| release: | |
| name: Release | |
| needs: | |
| - lint | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Check out the codebase | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Ansible | |
| run: pip3 install ansible-core | |
| - 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) | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true |