This commit is contained in:
+3
-24
@@ -5,29 +5,8 @@ on:
|
|||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
test:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
steps:
|
steps:
|
||||||
- name: Clone code
|
- name: Hello
|
||||||
run: |
|
run: echo "CI Pipeline triggered successfully on ${GITHUB_SHA}"
|
||||||
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"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user