- Add gitea/act_runner:0.3.0 to docker-compose stack on runner-jobs network - Add act_runner config template and directory provisioning - Add FORGEJO_RUNNER_TOKEN to env template - Add CI deploy SSH public key to authorized_keys via base role - Create .forgejo/workflows/deploy.yml: syntax-check on PR, deploy on push to master - Add .claude/launch.json with ansible-playbook configurations Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
51 lines
1.4 KiB
YAML
51 lines
1.4 KiB
YAML
name: CI/CD
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
jobs:
|
|
syntax-check:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: python:3.12-slim
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install ansible
|
|
run: pip install ansible --quiet
|
|
|
|
- name: Syntax check
|
|
run: ansible-playbook playbooks/deploy.yml --syntax-check -i inventory/
|
|
|
|
deploy:
|
|
needs: syntax-check
|
|
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: python:3.12-slim
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
apt-get update -qq && apt-get install -y openssh-client --no-install-recommends
|
|
pip install ansible --quiet
|
|
ansible-galaxy collection install ansible.posix community.general community.docker --quiet
|
|
|
|
- name: Configure SSH
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
|
chmod 600 ~/.ssh/id_ed25519
|
|
ssh-keyscan -p 22 87.249.49.32 >> ~/.ssh/known_hosts
|
|
|
|
- name: Write vault password
|
|
run: |
|
|
echo "${{ secrets.VAULT_PASSWORD }}" > ~/.vault-password-file
|
|
chmod 600 ~/.vault-password-file
|
|
|
|
- name: Deploy
|
|
run: ansible-playbook playbooks/deploy.yml -i inventory/
|