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
|
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_TAG
|
|
|
|
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
|
|
|
script:
|
2021-10-19 17:24:08 -06:00
|
|
|
- mkdir ~/.docker
|
2021-10-19 17:22:29 -06:00
|
|
|
- echo "$DOCKER_AUTH_CONFIG" > ~/.docker/config.json
|
2021-10-19 17:22:11 -06:00
|
|
|
- >
|
|
|
|
docker build
|
|
|
|
--tag ghcr.io/dirtbags/moth:$CI_COMMIT_REF_SLUG
|
|
|
|
--file build/package/Containerfile
|
|
|
|
.
|