This commit is contained in:
32
.gitea/workflows/ci.yaml
Normal file
32
.gitea/workflows/ci.yaml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
name: Build and Push
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: docker:27
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build image
|
||||||
|
run: |
|
||||||
|
docker build --platform linux/amd64 -t git.nodeup.ru/stackops/test-app:${{ gitea.sha }} .
|
||||||
|
docker tag git.nodeup.ru/stackops/test-app:${{ gitea.sha }} git.nodeup.ru/stackops/test-app:latest
|
||||||
|
|
||||||
|
- name: Push to registry
|
||||||
|
run: |
|
||||||
|
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:latest
|
||||||
|
|
||||||
|
- name: Deploy via StackOps
|
||||||
|
run: |
|
||||||
|
apk add --no-cache curl
|
||||||
|
curl -sf -X POST http://stackops-api.stackops.svc.cluster.local:8080/stackops.v1.StackOpsService/DeployProject \
|
||||||
|
-H "Authorization: Bearer ${{ secrets.STACKOPS_TOKEN }}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"projectId":"${{ secrets.PROJECT_ID }}"}'
|
||||||
Reference in New Issue
Block a user