Restore the gates on images running fix docker hub path for image Drop down one version on teh build plugin Drop down one version on teh build plugin Drop down one version on teh build plugin force test the build and push workflow fix image tag in ci/cd Set push to true on workflow fix argo command making a small change to get the pipeline to run tsting argocd action Test the filters workflow Test the filters workflow test check if python was changed check if python was changed Indent build block Trying more ci/cd shit Trying more ci/cd shit Trying more ci/cd shit Trying more ci/cd shit Trying more ci/cd shit Trying more ci/cd shit Trying more ci/cd shit tryin more shit more ci/cd testing more ci/cd testing commiting an obvious bad python change to see if CI/CD bails testing testing testing testing testing testing Testing workflow
74 lines
2.2 KiB
YAML
Executable File
74 lines
2.2 KiB
YAML
Executable File
name: Build and push
|
|
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
|
on: [push]
|
|
|
|
jobs:
|
|
changes:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
python_files: ${{ steps.filter.outputs.python_files }}
|
|
helm_files: ${{ steps.filter.outputs.helm }}
|
|
steps:
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4
|
|
- uses: dorny/paths-filter@v3
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
python_files:
|
|
- 'app/**'
|
|
helm:
|
|
- 'helm/**'
|
|
Lint-Python:
|
|
runs-on: ubuntu-latest
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.python_files == 'true' }}
|
|
steps:
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4
|
|
- uses: dorny/paths-filter@v3
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
python_files:
|
|
- 'app/**/*.py'
|
|
- name: install UV
|
|
run: |
|
|
pip install uv --quiet
|
|
if: steps.filter.outputs.python_files == 'true'
|
|
- name: install black and lint code
|
|
run: |
|
|
uv pip install black --system --quiet
|
|
black app --check --fast
|
|
if: steps.filter.outputs.python_files == 'true'
|
|
Build-and-Push-Docker:
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.python_files == 'true' }}
|
|
steps:
|
|
- name: Login to Docker Hub
|
|
if: github.event_name != 'pull_request'
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_TOKEN }}
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: |
|
|
ldooks/dragon-bot:latest
|
|
ldooks/dragon-bot:${{ gitea.run_id }}
|
|
sync-argocd-app:
|
|
needs: [changes, Build-and-Push-Docker]
|
|
if: ${{ needs.changes.outputs.python_files == 'true' }}
|
|
steps:
|
|
- name: Sync app in ArgoCD
|
|
uses: clowdhaus/argo-cd-action/@main
|
|
with:
|
|
version: 2.6.7
|
|
command: app
|
|
options: --insecure --server 192.168.1.205 --auth-token ${{ secrets.ARGOCD_TOKEN }} set dragon-bot --helm-set image.tag=${{ gitea.run_id }}
|