Release 3.7.0 #21
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy app | |
on: | |
release: | |
types: | |
- published | |
workflow_dispatch: | |
jobs: | |
tests: | |
name: Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install | |
run: npm install | |
- name: Launch tests | |
run: npm run test | |
deploy: | |
name: Deploy app | |
runs-on: ubuntu-latest | |
needs: [tests] | |
steps: | |
- name: Checkout Ansible | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
repository: thefirstspine/ansible | |
- name: Get config | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
repository: thefirstspine/ansible-secrets | |
path: tmp | |
token: ${{ secrets.ACCESS_TOKEN }} | |
- name: Get inventory | |
run: | | |
rm -rf volume/conf | |
rm -rf volume/keys | |
mv tmp/conf volume/conf | |
mv tmp/keys volume/keys | |
- name: Build Docker image | |
run: | | |
docker build -t thefirstspine/ansible . | |
- name: Run thefirstspine/ansible image | |
run: | | |
docker run --rm -v ./volume:/volume -e BRANCH=${GITHUB_REF#refs/*/} thefirstspine/ansible ansible-playbook -i /volume/conf/inventory.yaml /volume/playbooks/deploy-website.yaml |