action-ansible-playbook/.github/workflows/test.yml
2020-03-24 22:26:46 +01:00

36 lines
999 B
YAML

name: Test Action
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Test remote
run: |
docker build -t host -f Dockerfile.test .
docker build -t action -f Dockerfile .
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_DIRECTORY="${{github.workspace}}" \
-e INPUT_KEY="${{secrets.SSH_PRIVATE_KEY}}" \
-e INPUT_OPTIONS="--inventory hosts --limit remote" \
action
- name: Test local
uses: ./
with:
playbook: playbook.yml
key: ${{secrets.SSH_PRIVATE_KEY}}
options: |
--inventory hosts
--limit local