forked from Yara724/api
Mount only the registry login file so Buildx can write temporary state. Build and deploy the latest image tag.
33 lines
910 B
YAML
33 lines
910 B
YAML
when:
|
|
- event: push
|
|
branch: main
|
|
- event: manual
|
|
branch: main
|
|
|
|
labels:
|
|
hostname: build-parspack
|
|
|
|
steps:
|
|
build:
|
|
image: docker.arvancloud.ir/docker:24-cli
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- /home/opsadmin/.docker/config.json:/root/.docker/config.json:ro
|
|
commands:
|
|
- export YARA_IMAGE="registry.ittalie.com/yara724-maintenance-api:latest"
|
|
- docker build -t "$YARA_IMAGE" .
|
|
- docker push "$YARA_IMAGE"
|
|
|
|
notify-failure:
|
|
image: docker.arvancloud.ir/alpine:3.20
|
|
environment:
|
|
ROCKETCHAT_WEBHOOK:
|
|
from_secret: rocketchat_webhook
|
|
when:
|
|
- status: failure
|
|
commands:
|
|
- apk add --no-cache curl jq > /dev/null
|
|
- |
|
|
jq -n --arg text "Yara724 api build failed. $CI_PIPELINE_URL" '{text: $text}' |
|
|
curl -fsS -H 'Content-Type: application/json' --data-binary @- "$ROCKETCHAT_WEBHOOK"
|