-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b49ccad
commit 112a74c
Showing
2 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Deploy app (dev) | ||
on: | ||
push: | ||
branches: | ||
- 'next' | ||
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-dev | ||
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=next thefirstspine/ansible ansible-playbook -i /volume/conf/inventory.yaml /volume/playbooks/deploy-website.yaml |
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