2021-10-18 18:22:00 -06:00
|
|
|
stages:
|
|
|
|
- test
|
|
|
|
- push
|
|
|
|
|
|
|
|
test:
|
2021-10-18 18:59:15 -06:00
|
|
|
stage: test
|
2021-10-18 18:22:00 -06:00
|
|
|
image: golang:1.17
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- main
|
|
|
|
- merge_requests
|
|
|
|
script:
|
|
|
|
- go test ./...
|
|
|
|
|
|
|
|
push:
|
|
|
|
stage: push
|
2021-10-18 18:59:15 -06:00
|
|
|
image: docker:20
|
2021-10-18 18:22:00 -06:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_TAG
|
|
|
|
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
|
|
|
script:
|
2021-10-18 18:52:05 -06:00
|
|
|
- >
|
2021-10-18 19:05:17 -06:00
|
|
|
docker build
|
2021-10-18 18:52:05 -06:00
|
|
|
--file build/package/Containerfile
|
|
|
|
--tag ghcr.io/dirtbags/moth:${CI_COMMIT_REF_SLUG}
|
|
|
|
.
|
|
|
|
- >
|
|
|
|
docker push
|
|
|
|
ghcr.io/dirtbags/moth:${CI_COMMIT_REF_SLUG}
|