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 }}"
|
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 }}
|
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:
|
docker-compose-ansible-lints:
|
||||||
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:
|
|
||||||
name: Docker Compose Test
|
name: Docker Compose Test
|
||||||
needs: [check-and-create-pr]
|
needs: [check-and-create-pr]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -74,7 +60,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
vault-release: '1.18.3'
|
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: |
|
run: |
|
||||||
vault kv get -format=json rinoa-docker/env | jq -r '.data.data' | jq -r 'keys[] as $k | "\($k)='\''\(.[$k])'\''"' > .env
|
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:
|
cloudflare-dns-setup:
|
||||||
name: Cloudflare DNS Setup
|
name: Cloudflare DNS Setup
|
||||||
needs: [docker-compose-test]
|
needs: [docker-compose-ansible-lints]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -228,8 +220,8 @@ jobs:
|
|||||||
playbook: ansible/playbook.yml
|
playbook: ansible/playbook.yml
|
||||||
inventory: ansible/inventory
|
inventory: ansible/inventory
|
||||||
|
|
||||||
docker-compose-deploy:
|
docker-compose-and-ansible-config-deploy:
|
||||||
name: Deploy via Docker Compose
|
name: Deploy via Ansible & Docker Compose
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [ansible-config-deploy]
|
needs: [ansible-config-deploy]
|
||||||
env:
|
env:
|
||||||
@@ -249,6 +241,17 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
vault kv get -format=json rinoa-docker/env | jq -r '.data.data' | jq -r 'keys[] as $k | "\($k)='\''\(.[$k])'\''"' > .env
|
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
|
- name: Docker Compose Deployment
|
||||||
uses: keatonLiu/docker-compose-remote-action@v1.2
|
uses: keatonLiu/docker-compose-remote-action@v1.2
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user