inventory/.woodpecker.yml
garionion e70c9d48fb
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
refactor: Update Woodpecker CI config and StorageHierarchy component
2025-03-02 11:54:57 +01:00

72 lines
1.4 KiB
YAML

variables:
- &golang_image 'golang:1.24'
steps:
backend-lint:
image: *golang_image
commands:
- go vet ./...
- go fmt ./...
when:
event: [push, tag]
frontend-lint:
image: node:20
commands:
- cd web
- npm ci
- npm run lint
when:
event: [ push, tag ]
frontend-build:
image: node:20
commands:
- cd web
- npm ci
- npm run build
depends_on:
- frontend-lint
when:
event: [ push, tag ]
backend-build:
image: *golang_image
commands:
- go mod download
- go generate ./...
# Build with embedded frontend
- go build -o inventory -ldflags="-s -w" .
depends_on:
- frontend-build
- backend-lint
when:
event: [ push, tag ]
# Create artifacts
artifacts:
image: alpine:latest
commands:
- mkdir -p artifacts
- cp inventory artifacts/
- tar -czvf artifacts/inventory.tar.gz inventory
depends_on:
- backend-build
when:
event: [ push, tag ]
# Optional step for creating a Docker image
#docker-build:
# image: plugins/docker
# settings:
# repo: ${DRONE_REPO_OWNER}/inventory
# tags:
# - latest
# - ${DRONE_TAG##v}
# dockerfile: Dockerfile
# depends_on:
# - backend-lint
# - frontend-lint
# when:
# branch: main
# event: [push, tag]