fix CI: use git clone instead of actions/checkout in docker:27
Some checks failed
Build and Deploy / build (push) Failing after 59s
Some checks failed
Build and Deploy / build (push) Failing after 59s
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: Build and Push
|
name: Build and Deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -10,22 +10,26 @@ jobs:
|
|||||||
container:
|
container:
|
||||||
image: docker:27
|
image: docker:27
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
|
run: |
|
||||||
|
apk add --no-cache git curl
|
||||||
|
git clone --depth 1 --branch ${GITHUB_REF_NAME} \
|
||||||
|
http://gitea-http.gitea.svc.cluster.local:3000/${GITHUB_REPOSITORY}.git .
|
||||||
|
|
||||||
- name: Build image
|
- name: Build image
|
||||||
run: |
|
run: |
|
||||||
docker build --platform linux/amd64 -t git.nodeup.ru/stackops/test-app:${{ gitea.sha }} .
|
IMAGE=git.nodeup.ru/stackops/test-app:${GITHUB_SHA::8}
|
||||||
docker tag git.nodeup.ru/stackops/test-app:${{ gitea.sha }} git.nodeup.ru/stackops/test-app:latest
|
docker build -t $IMAGE .
|
||||||
|
docker tag $IMAGE git.nodeup.ru/stackops/test-app:latest
|
||||||
|
|
||||||
- name: Push to registry
|
- name: Push to registry
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login git.nodeup.ru -u stackops --password-stdin
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login git.nodeup.ru -u stackops --password-stdin
|
||||||
docker push git.nodeup.ru/stackops/test-app:${{ gitea.sha }}
|
docker push git.nodeup.ru/stackops/test-app:${GITHUB_SHA::8}
|
||||||
docker push git.nodeup.ru/stackops/test-app:latest
|
docker push git.nodeup.ru/stackops/test-app:latest
|
||||||
|
|
||||||
- name: Deploy via StackOps
|
- name: Deploy via StackOps
|
||||||
run: |
|
run: |
|
||||||
apk add --no-cache curl
|
|
||||||
curl -sf -X POST http://stackops-api.stackops.svc.cluster.local:8080/stackops.v1.StackOpsService/DeployProject \
|
curl -sf -X POST http://stackops-api.stackops.svc.cluster.local:8080/stackops.v1.StackOpsService/DeployProject \
|
||||||
-H "Authorization: Bearer ${{ secrets.STACKOPS_TOKEN }}" \
|
-H "Authorization: Bearer ${{ secrets.STACKOPS_TOKEN }}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
|
|||||||
Reference in New Issue
Block a user