2020-03-21 16:06:40 +00:00
|
|
|
name: Test Action
|
|
|
|
|
|
|
|
on: push
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-03-22 11:17:17 +00:00
|
|
|
- name: Checkout code
|
2020-03-21 16:06:40 +00:00
|
|
|
uses: actions/checkout@v2
|
2020-03-22 11:17:17 +00:00
|
|
|
- name: Test remote
|
|
|
|
run: |
|
|
|
|
docker build -t host -f Dockerfile.test .
|
|
|
|
docker build -t action -f Dockerfile .
|
2020-03-22 11:27:35 +00:00
|
|
|
docker run -d \
|
|
|
|
--name host \
|
|
|
|
-e SSH_PUBLIC_KEY="${{secrets.SSH_PUBLIC_KEY}}" \
|
|
|
|
host
|
|
|
|
docker run -t \
|
|
|
|
--name action \
|
|
|
|
--link host \
|
|
|
|
-v $PWD:/wd \
|
|
|
|
-w /wd \
|
|
|
|
-e INPUT_PLAYBOOK=playbook.yml \
|
|
|
|
-e INPUT_KEY="${{secrets.SSH_PRIVATE_KEY}}" \
|
2020-03-22 11:47:57 +00:00
|
|
|
-e INPUT_OPTIONS="--inventory hosts --limit remote" \
|
2020-03-22 11:27:35 +00:00
|
|
|
action
|
2020-03-22 11:17:17 +00:00
|
|
|
- name: Test local
|
2020-03-21 16:06:40 +00:00
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
playbook: playbook.yml
|
2020-03-21 18:44:53 +00:00
|
|
|
key: ${{secrets.SSH_PRIVATE_KEY}}
|
2020-03-21 16:06:40 +00:00
|
|
|
options: |
|
2020-03-22 11:47:57 +00:00
|
|
|
--inventory hosts
|
|
|
|
--limit local
|