]> git.immae.eu Git - github/fretlink/ansible-rundeck-jobs.git/blame - .github/workflows/pr.yml
publish to ansible galaxy on release
[github/fretlink/ansible-rundeck-jobs.git] / .github / workflows / pr.yml
CommitLineData
ce8b31de
GD
1name: Test PR
2on:
3 push:
4 branches:
5 - master
6 pull_request:
7 branches:
8 - master
ab34f62e
GD
9 release:
10 types: [created, edited, published]
ce8b31de
GD
11jobs:
12 tests:
13 runs-on: ubuntu-latest
14 services:
15 rundeck:
2acad55d 16 image: fretlink/rundeckforci:3.4.7-latest
ce8b31de
GD
17 ports:
18 - 4440:4440
19 env:
2acad55d 20 RUNDECK_TOKENS_FILE: /etc/tokens.properties
ce8b31de
GD
21 options: >-
22 --health-interval=10s
23 --health-cmd="wget -t 1 -q -O /dev/null http://localhost:4440"
24 --health-timeout 5s
25 --health-retries 15
26
27 steps:
28 - uses: actions/checkout@v2
1371725a 29 with:
1371725a 30 path: "${{ github.repository }}"
ce8b31de 31 - run: |
1371725a
GD
32 sudo apt update && sudo apt install -y python3-pip
33 pip3 install -r ${{ github.repository }}/requirements.txt
34 pip3 install -r ${{ github.repository }}/tests/requirements.txt
35 - run: http --ignore-stdin localhost:4440/api/26/projects name=test X-Rundeck-Auth-Token:testtoken Accept:application/json
ce8b31de 36 - run: |
1371725a 37 cd ${{ github.repository }}/tests && ansible-playbook -i inventory test.yml
ab34f62e
GD
38 publish:
39 runs-on: ubuntu-latest
40 needs: tests
41 if: ${{ github.event_name == 'release' }}
42 steps:
43 - uses: actions/checkout@v2
44 - name: Upload to ansible-galaxy
45 uses: artis3n/ansible_galaxy_collection@v2
46 with:
47 api_key: '${{ secrets.GALAXY_API_KEY }}'
48 galaxy_version: '${{ github.event.release.tag_name }}'