Merging the lint steps into one and deploy steps into another.
This commit is contained in:
@@ -41,21 +41,7 @@ jobs:
|
||||
echo "Creating PR for branch: ${{ github.ref_name }}"
|
||||
tea pr c -r ${{ github.repository }} -t "Automated PR for ${{ github.ref_name }}" -d "Automatically created PR for branch: ${{ github.ref_name }}" -a ${{ github.actor }}
|
||||
|
||||
anisble-run:
|
||||
name: Ansible Run
|
||||
needs: [check-and-create-pr]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Ansible Lint
|
||||
uses: ansible/ansible-lint@v24.12.2
|
||||
with:
|
||||
working_directory: "./ansible"
|
||||
requirements_file: "./ansible/collections/ansible_collections/requirements.yml"
|
||||
|
||||
docker-compose-test:
|
||||
docker-compose-ansible-lints:
|
||||
name: Docker Compose Test
|
||||
needs: [check-and-create-pr]
|
||||
runs-on: ubuntu-latest
|
||||
@@ -74,7 +60,13 @@ jobs:
|
||||
with:
|
||||
vault-release: '1.18.3'
|
||||
|
||||
- name: Generate .env file for linting
|
||||
- name: Ansible Lint
|
||||
uses: ansible/ansible-lint@v24.12.2
|
||||
with:
|
||||
working_directory: "ansible"
|
||||
requirements_file: "collections/ansible_collections/requirements.yml"
|
||||
|
||||
- name: Generate .env file for docker compose linting
|
||||
run: |
|
||||
vault kv get -format=json rinoa-docker/env | jq -r '.data.data' | jq -r 'keys[] as $k | "\($k)='\''\(.[$k])'\''"' > .env
|
||||
|
||||
@@ -91,7 +83,7 @@ jobs:
|
||||
|
||||
cloudflare-dns-setup:
|
||||
name: Cloudflare DNS Setup
|
||||
needs: [docker-compose-test]
|
||||
needs: [docker-compose-ansible-lints]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -228,8 +220,8 @@ jobs:
|
||||
playbook: ansible/playbook.yml
|
||||
inventory: ansible/inventory
|
||||
|
||||
docker-compose-deploy:
|
||||
name: Deploy via Docker Compose
|
||||
docker-compose-and-ansible-config-deploy:
|
||||
name: Deploy via Ansible & Docker Compose
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ansible-config-deploy]
|
||||
env:
|
||||
@@ -249,6 +241,17 @@ jobs:
|
||||
run: |
|
||||
vault kv get -format=json rinoa-docker/env | jq -r '.data.data' | jq -r 'keys[] as $k | "\($k)='\''\(.[$k])'\''"' > .env
|
||||
|
||||
- name: Install Ansible
|
||||
uses: alex-oleshkevich/setup-ansible@v1.0.1
|
||||
with:
|
||||
version: "2.18.1"
|
||||
|
||||
- name: Run Ansible Playbook
|
||||
uses: euclid1990/actions-ansible@v2
|
||||
with:
|
||||
playbook: ansible/playbook.yml
|
||||
inventory: ansible/inventory
|
||||
|
||||
- name: Docker Compose Deployment
|
||||
uses: keatonLiu/docker-compose-remote-action@v1.2
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user