Files
k8s-version-tracker/.gitea/workflows/ci-cd.yml
ai_approver 00b0fd455a
Some checks failed
CI/CD / lint-test (push) Failing after 3m16s
CI/CD / build-push (push) Has been skipped
feat: Gitea Actions CI/CD pipeline
2026-05-03 01:26:18 +00:00

56 lines
1.6 KiB
YAML

name: CI/CD
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: pip install ruff mypy -r requirements.txt
- name: Lint
run: ruff check .
- name: Type check
run: mypy check_versions.py --ignore-missing-imports
build-push:
runs-on: ubuntu-latest
needs: lint-test
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Build image
run: |
docker build -t ${{ secrets.REGISTRY_URL }}/k8s-version-tracker:${{ github.sha }} \
-t ${{ secrets.REGISTRY_URL }}/k8s-version-tracker:latest .
- name: Push image
run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" | \
docker login ${{ secrets.REGISTRY_URL }} -u ${{ secrets.REGISTRY_USERNAME }} --password-stdin
docker push ${{ secrets.REGISTRY_URL }}/k8s-version-tracker:${{ github.sha }}
docker push ${{ secrets.REGISTRY_URL }}/k8s-version-tracker:latest
- name: Notify Mattermost
if: always()
run: |
STATUS="${{ job.status }}"
EMOJI=$([ "$STATUS" = "success" ] && echo ":white_check_mark:" || echo ":x:")
curl -s -X POST "${{ secrets.MATTERMOST_WEBHOOK_URL }}" \
-H "Content-Type: application/json" \
-d "{\"text\": \"$EMOJI k8s-version-tracker build **$STATUS** — \`${{ github.sha }}\`\"}"