Skip to content

Commit

Permalink
ci(publish): create import role workflow
Browse files Browse the repository at this point in the history
Import role on galaxy on each release
  • Loading branch information
chubchubsancho committed Oct 4, 2022
1 parent 3e8282d commit 99ed6b8
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish on ansible galaxy
on:
release:
types:
- published

jobs:
publis:
name: Release
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v3.0.2

- name: Set up Python 3.
uses: actions/setup-python@v4.2.0
with:
python-version: "3.x"

- 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)
6 changes: 2 additions & 4 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@ galaxy_info:

license: MIT

min_ansible_version: 2.7
min_ansible_version: "2.7"

platforms:
- name: Debian
versions:
- stretch
- buster
- bullseye
- name: Ubuntu
versions:
- bionic
- focal
- impish
- jammy

galaxy_tags:
- pihole
Expand Down
2 changes: 0 additions & 2 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ platforms:
image: "$image:$version"
command: /sbin/init
privileged: true
env:
container: docker
groups:
- "default"
tmpfs:
Expand Down
3 changes: 2 additions & 1 deletion tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
ansible.builtin.file:
name: /etc/pihole
state: directory
mode: 0644
when: pihole_installed.stat.isdir is undefined
tags:
- pihole
Expand All @@ -29,7 +30,7 @@
- installation
- prepare

- name: Clone pihole repository revision '{{ pi_hole_version }}'
- name: Clone pihole repository revision {{ pi_hole_version }}
ansible.builtin.git:
repo: "{{ pi_hole_repo }}"
clone: true
Expand Down

0 comments on commit 99ed6b8

Please sign in to comment.