This repository has been archived by the owner on Nov 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
workflow-publish-to-galaxy.yml
74 lines (63 loc) · 2.54 KB
/
workflow-publish-to-galaxy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
name: {{ cookiecutter.project_slug }}-github-workflow-publish-to-galaxy
# For further details please consult the documentation here:
# https://github.com/niall-byrne/ansible-workbench
# Begin Cookiecutter Template Content{% raw %}
on:
release:
types: [published]
workflow_dispatch:
inputs:
TAG:
description: 'Tag to Deploy'
required: true
default: ''
# secrets:
# GALAXY_API_KEY:
# description: "Optional, enables importing the role into Ansible Galaxy."
# required: false
# SLACK_WEBHOOK:
# description: "Optional, enables Slack notifications."
# required: false
jobs:
configuration:
uses: cicd-tools-org/cicd-tools/.github/workflows/job-00-generic-read_json_file.yml@master
with:
JSON_FILE_PATH: ".github/config/workflows/workflow-publish-to-galaxy.json"
api_key_exists:
secrets:
SECRET: ${{ secrets.GALAXY_API_KEY }}
uses: cicd-tools-org/cicd-tools/.github/workflows/job-00-generic-identify_secret_exists.yml@master
start:
if: needs.api_key_exists.outputs.EXISTS == 'true'
needs: [api_key_exists]
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: cicd-tools-org/cicd-tools/.github/workflows/job-00-generic-notification.yml@master
with:
NOTIFICATION_EMOJI: ":vertical_traffic_light:"
NOTIFICATION_MESSAGE: "Ansible Galaxy release workflow has started!"
WORKFLOW_NAME: "galaxy"
publish_to_galaxy:
if: needs.api_key_exists.outputs.EXISTS == 'true'
needs: [api_key_exists, configuration, start]
secrets:
GALAXY_API_KEY: ${{ secrets.GALAXY_API_KEY }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: cicd-tools-org/cicd-tools/.github/workflows/job-95-poetry-galaxy_import_role.yml@master
with:
PYTHON_VERSION: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_python_version }}
WORKFLOW_DISPATCH: ${{ github.event_name == 'workflow_dispatch' }}
VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }}
WORKFLOW_NAME: "galaxy"
success:
if: needs.api_key_exists.outputs.EXISTS == 'true'
needs: [api_key_exists, publish_to_galaxy]
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: cicd-tools-org/cicd-tools/.github/workflows/job-00-generic-notification.yml@master
with:
NOTIFICATION_EMOJI: ":checkered_flag:"
NOTIFICATION_MESSAGE: "Ansible Galaxy release workflow has completed successfully!"
WORKFLOW_NAME: "galaxy"
# End Cookiecutter Template Content{% endraw %}