Files
Wordpress-Ansible/.gitea/workflows/yamllint.yml
sotos f28f43bdab
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 41s
asdf
2025-12-17 09:00:00 +01:00

67 lines
1.5 KiB
YAML

---
name: CI/CD Pipeline
on:
push:
branches: [main, flip_dev]
jobs:
lint:
runs-on: docker
container:
image: node:20-bullseye
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Python & linters
run: |
apt-get update && apt-get install -y python3 python3-pip bash git
pip3 install --upgrade pip
pip3 install yamllint ansible-lint
- name: Run linters
run: |
yamllint .
deploy:
runs-on: docker
container:
image: node:20-bullseye
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Ansible & dependencies
run: |
apt-get update && apt-get install -y python3 python3-pip openssh-client bash git
pip3 install --upgrade pip
pip3 install ansible
- name: Setup SSH
shell: bash
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_PASSPHRASE: ${{ secrets.SSH_PASSPHRASE }}
run: |
set -euo pipefail
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H 213.95.90.157 >> ~/.ssh/known_hosts
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa <<< "$SSH_PASSPHRASE"
ssh -o BatchMode=yes root@213.95.90.157 "echo SSH OK"
- name: Run Ansible
run: |
ansible-playbook -i ansible/inventory.yaml site.yaml