mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Deploy role to ansible galaxy
Happens only when a new tag is pushed
This commit is contained in:
32
.github/workflows/ansible.yml
vendored
32
.github/workflows/ansible.yml
vendored
@@ -1,14 +1,14 @@
|
||||
---
|
||||
name: Ansible Role
|
||||
|
||||
on: push
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
# https://molecule.readthedocs.io/en/latest/ci.html#github-actions
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
# https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#github-context
|
||||
if: contains(github.ref, 'refs/heads/')
|
||||
if: github.event_name == 'pull_request' || (github.event_name == 'push' && contains(github.ref, 'refs/heads/'))
|
||||
steps:
|
||||
- name: Check out the codebase
|
||||
uses: actions/checkout@v2
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
path: "${{ github.repository }}"
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
- name: Set up Docker
|
||||
- name: Set up Docker
|
||||
uses: docker-practice/actions-setup-docker@master
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
@@ -31,3 +31,27 @@ jobs:
|
||||
cd ansible
|
||||
molecule test
|
||||
working-directory: "${{ github.repository }}"
|
||||
# https://galaxy.ansible.com/docs/contributing/importing.html
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- test
|
||||
# https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#github-context
|
||||
if: contains(github.ref, 'refs/tags/')
|
||||
steps:
|
||||
- name: Check out the codebase
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: "${{ github.repository }}"
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python3 -m pip install --upgrade ansible-base
|
||||
ansible --version
|
||||
python --version
|
||||
- name: Trigger a new import on Galaxy
|
||||
run: |
|
||||
cd ansible
|
||||
ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2)
|
||||
working-directory: "${{ github.repository }}"
|
||||
|
Reference in New Issue
Block a user