Files
fastapi-demo/.gitea/workflows/ci.yml
T
admin 4351056969
CI/CD Pipeline / build-and-deploy (push) Failing after 1s
ci: replace actions/checkout with native git clone
2026-06-16 16:01:47 +08:00

34 lines
982 B
YAML

name: CI/CD Pipeline
on:
push:
branches: [main]
jobs:
build-and-deploy:
runs-on: docker
steps:
- name: Clone code
run: |
git clone https://git.plfai.cn/test/fastapi-demo.git .
git checkout ${GITHUB_SHA}
- name: Docker Build
run: |
docker build --network host \
-t registry.plfai.cn/fastapi-demo:${GITHUB_SHA:0:7} \
-t registry.plfai.cn/fastapi-demo:latest \
.
- name: Docker Push
run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login registry.plfai.cn -u k3s --password-stdin
docker push registry.plfai.cn/fastapi-demo:${GITHUB_SHA:0:7}
docker push registry.plfai.cn/fastapi-demo:latest
- name: ArgoCD Sync
run: |
curl -sk -o /dev/null -X POST \
-H "Authorization: Bearer ${{ secrets.ARGOCD_TOKEN }}" \
"https://argocd.plfai.cn/api/v1/applications/fastapi-demo/sync"