mirror of https://github.com/dirtbags/moth.git
30 lines
497 B
YAML
30 lines
497 B
YAML
stages:
|
|
- test
|
|
- push
|
|
|
|
test:
|
|
stage: test
|
|
image: golang:1.17
|
|
only:
|
|
refs:
|
|
- main
|
|
- merge_requests
|
|
script:
|
|
- go test ./...
|
|
|
|
push:
|
|
stage: push
|
|
image: docker:20
|
|
rules:
|
|
- if: $CI_COMMIT_TAG
|
|
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
|
script:
|
|
- >
|
|
docker build
|
|
--file build/package/Containerfile
|
|
--tag ghcr.io/dirtbags/moth:${CI_COMMIT_REF_SLUG}
|
|
.
|
|
- >
|
|
docker push
|
|
ghcr.io/dirtbags/moth:${CI_COMMIT_REF_SLUG}
|