-
Notifications
You must be signed in to change notification settings - Fork 3
59 lines (50 loc) · 1.81 KB
/
Copy pathgalaxy.yaml
File metadata and controls
59 lines (50 loc) · 1.81 KB
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
name: Build & Publish Ansible Galaxy Collection
on:
create:
tags:
- '*'
jobs:
build-and-publish-collection:
runs-on: ubuntu-20.04
steps:
- name: Checkout Repo
uses: actions/checkout@v2.4.0
- name: Export Variables
id: github_ref
run: |
set -ex; \
echo "github_ref: $GITHUB_REF" ;\
echo ::set-output name=GITHUB_REF_TAG::$(echo $GITHUB_REF | awk -F/ '{print $NF}' | awk -F- '{print $NF}'); \
echo;
- name: Setup Python
uses: actions/setup-python@v4.1.0
with:
python-version: '3.x'
- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
- name: Install ansible
run: pip install -U -r requirements.txt
- name: Template Ansible File galaxy.yml
run: |
ansible localhost --connection local \
-i localhost -m template \
-a "src=templates/kubespray-galaxy.yml.j2 dest=kubespray/galaxy.yml" \
-e "github_ref=0.${{ steps.github_ref.outputs.GITHUB_REF_TAG }}"
- name: Build & Publish Collection | Kubespray
run: |
set -x ; \
mkdir -p galaxy ;\
ansible-galaxy collection build --output-path galaxy kubespray ;\
ansible-galaxy collection publish --api-key=${{ secrets.ANSIBLE_GALAXY_API_KEY }} \
galaxy/containercraft-kubespray-0.${{ steps.github_ref.outputs.GITHUB_REF_TAG }}.tar.gz ; \
echo;
- name: Build Konductor Kubespray Container Image
if: success()
uses: peter-evans/repository-dispatch@v1.1.3
with:
event-type: container
token: ${{ secrets.GH_ACTIONS_TOKEN }}
repository: ${{ github.repository }}
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'