Skip to content

Commit

Permalink
refactor(ci): refactor ci scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mullholland committed Dec 3, 2023
1 parent 331d29b commit f6b330c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
# Ansible managed
#

name: Release to Ansible Galaxy
name: Ansible Galaxy

# Only release to ansible galaxy if semantic release was successful
on:
release:
types: [created, edited, published, released]
workflow_run:
workflows: [Semantic release]
types:
- completed

jobs:
release:
runs-on: ubuntu-20.04
Expand All @@ -16,3 +20,4 @@ jobs:
uses: robertdebock/[email protected]
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}
git_branch: main
15 changes: 10 additions & 5 deletions .github/workflows/go-semantic-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
# Ansible managed
#

name: Create a semantic release on push to main
name: Semantic release


# Only release if molecule works and on main branch
on:
push:
branches:
- "main"
workflow_run:
workflows: [Molecule]
branches: [main]
types:
- completed

# If a 403 error occurs, make sure to set content permission to write
# see: https:/go-semantic-release/action/issues/27
Expand All @@ -20,7 +24,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: go-semantic-release/action@v1
- name: go-semantic-release
uses: go-semantic-release/action@v1
id: semrel
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Ansible managed
#

name: Ansible Molecule
name: Molecule

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Installs and configures Docker.

|GitHub|Downloads|Version|
|------|---------|-------|
|[![github](https:/mullholland/ansible-role-docker/actions/workflows/molecule.yml/badge.svg)](https:/mullholland/ansible-role-docker/actions/workflows/molecule.yml)|[![downloads](https://img.shields.io/ansible/role/d/)](https://galaxy.ansible.com/mullholland/docker)|[![Version](https://img.shields.io/github/release/mullholland/ansible-role-docker.svg)](https:/mullholland/ansible-role-docker/releases/)|
|[![github](https:/mullholland/ansible-role-docker/actions/workflows/molecule.yml/badge.svg)](https:/mullholland/ansible-role-docker/actions/workflows/molecule.yml)|[![downloads](https://img.shields.io/ansible/role/d/mullholland/docker)](https://galaxy.ansible.com/mullholland/docker)|[![Version](https://img.shields.io/github/release/mullholland/ansible-role-docker.svg)](https:/mullholland/ansible-role-docker/releases/)|
## [Example Playbook](#example-playbook)

This example is taken from [`molecule/default/converge.yml`](https:/mullholland/ansible-role-docker/blob/master/molecule/default/converge.yml) and is tested on each push, pull request and release.
Expand Down

0 comments on commit f6b330c

Please sign in to comment.