Files
johto-infra/.gitea/workflows/ansible-cicd.yaml
T
jdelpilarandJordan Del Pilar 3b15923d8d
Johto Infrastructure Pipeline / Run Ansible Lint (push) Successful in 1m44s
Johto Infrastructure Pipeline / Deploy to Production (push) Successful in 2m10s
fix: CI/CD pipeline fix (#7)
This PR fixes an issue with how the CI/CD pipeline was setup up

## Major fixes
- Addressed an issue with the CI/CD pipeline restarting core services during production runs.
	- Updated ansible-playbook command to include the `skip-tags` flag. This currently skips the new `core` tag. | 19a7e77045
	- Added new `core` tag to `site.yaml`. This new tag covers any roles that deal with or might restart core services. | 3335594077

---------

Co-authored-by: Jordan Del Pilar <[email protected]>
Reviewed-on: #7
2026-07-08 14:54:29 -07:00

60 lines
1.4 KiB
YAML

name: Johto Infrastructure Pipeline
on:
push:
branches:
- '**'
jobs:
lint:
name: Run Ansible Lint
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Ansible and Lint
run: |
sudo apt-get update
sudo apt-get install -y ansible ansible-lint
- name: Inject Vault Password
run: printf "%s" "$VAULT_PASS" > .vault-pass.txt
env:
VAULT_PASS: ${{ secrets.ANSIBLE_VAULT_PASSWORD }}
- name: Lint Playbooks
run: ansible-lint site.yaml
deploy:
name: Deploy to Production
runs-on: ubuntu-latest
needs: lint
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Ansible
run: |
sudo apt-get update
sudo apt-get install -y ansible
- name: Inject SSH Key for Ansible
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.ANSIBLE_SSH_KEY }}
- name: Add Headscale IPs to Known Hosts
run: |
mkdir -p ~/.ssh
ssh-keyscan 100.64.0.1 100.64.0.2 >> ~/.ssh/known_hosts
- name: Inject Vault Password
run: printf "%s" "$VAULT_PASS" > .vault-pass.txt
env:
VAULT_PASS: ${{ secrets.ANSIBLE_VAULT_PASSWORD }}
- name: Run Ansible Playbook
run: ansible-playbook site.yaml --skip-tags "core"