Add gitea ci actions #40
53
.drone.yml
53
.drone.yml
@@ -1,53 +0,0 @@
|
|||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: ansible
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: yaml lint
|
|
||||||
image: cytopia/yamllint:alpine
|
|
||||||
commands:
|
|
||||||
- yamllint -c .yamllint.yml .
|
|
||||||
|
|
||||||
- name: ansible lint
|
|
||||||
image: cytopia/ansible-lint:alpine
|
|
||||||
commands:
|
|
||||||
- ansible-lint .
|
|
||||||
|
|
||||||
- name: setup ssh key
|
|
||||||
image: cytopia/ansible:latest-infra
|
|
||||||
commands:
|
|
||||||
- mkdir -p /root/.ssh
|
|
||||||
- echo "$SSH_KEY" > /root/.ssh/id_ed25519
|
|
||||||
- chmod 600 /root/.ssh/id_ed25519
|
|
||||||
- ssh-keyscan -p 4422 vps.noahknegt.com > /root/.ssh/known_hosts
|
|
||||||
environment:
|
|
||||||
SSH_KEY:
|
|
||||||
from_secret: ssh_key
|
|
||||||
volumes:
|
|
||||||
- name: ssh_key
|
|
||||||
path: /root/.ssh
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
|
|
||||||
- name: ansible apply
|
|
||||||
image: cytopia/ansible:latest-infra
|
|
||||||
commands:
|
|
||||||
- eval `ssh-agent -s`
|
|
||||||
- ssh-add /root/.ssh/id_ed25519
|
|
||||||
- ansible-playbook -i inventory/hosts.yml site.yml
|
|
||||||
volumes:
|
|
||||||
- name: ssh_key
|
|
||||||
path: /root/.ssh
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
- name: ssh_key
|
|
||||||
temp: {}
|
|
33
.gitea/workflows/lint.yml
Normal file
33
.gitea/workflows/lint.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
name: Linting
|
||||||
|
run-name: Linting ansible and yaml files
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
yaml-lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout source code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install yaml-lint # As yamllint action is a composite it does not install yamllint itself
|
||||||
|
run: |
|
||||||
|
apt update
|
||||||
|
apt install -y --no-install-recommends yamllint
|
||||||
|
|
||||||
|
- name: Lint with yaml-lint
|
||||||
|
uses: ibiqlik/action-yamllint@v3
|
||||||
|
with:
|
||||||
|
config_file: .yamllint.yml
|
||||||
|
|
||||||
|
ansible-lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout source code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Lint with ansible lint
|
||||||
|
uses: ansible/ansible-lint@v24
|
Reference in New Issue
Block a user