GoScrobble/.gitlab-ci.yml

53 lines
979 B
YAML
Raw Normal View History

2021-03-27 06:47:21 +00:00
stages:
- build
- bundle
2021-03-27 07:24:17 +00:00
variables:
2021-08-13 09:37:53 +00:00
VERSION: 0.0.32
2021-03-27 07:24:17 +00:00
2021-03-27 06:47:21 +00:00
build-go:
2021-08-13 09:37:53 +00:00
image: golang:1.16.7
2021-03-27 06:47:21 +00:00
stage: build
only:
- master
2021-03-27 06:47:21 +00:00
script:
- go build -o goscrobble cmd/go-scrobble/*.go
artifacts:
expire_in: 1 day
paths:
- goscrobble
- migrations
- init
2021-03-27 22:01:58 +00:00
- .env.example
2021-03-27 06:47:21 +00:00
build-react:
image: node:15.12.0
stage: build
only:
- master
2021-03-27 06:47:21 +00:00
script:
- cd web
- npm install
2021-03-27 22:01:58 +00:00
- npm run build --env production
2021-03-27 06:47:21 +00:00
artifacts:
expire_in: 1 day
paths:
- web/build
bundle:
2021-03-27 07:24:17 +00:00
image: bash:latest
2021-03-27 06:47:21 +00:00
stage: bundle
only:
- master
2021-03-27 06:47:21 +00:00
variables:
GIT_STRATEGY: none
2021-03-27 07:24:17 +00:00
before_script:
- apk add --no-cache zip tar
2021-03-27 06:47:21 +00:00
script:
2021-03-27 22:01:58 +00:00
- zip -r goscrobble.${VERSION}.zip web/build goscrobble migrations init .env.example
- tar -czf goscrobble.${VERSION}.tar.gz web/build goscrobble migrations init .env.example
2021-03-27 07:24:17 +00:00
artifacts:
2021-03-27 22:01:58 +00:00
expire_in: 1 week
2021-03-27 07:24:17 +00:00
paths:
- goscrobble.${VERSION}.zip
- goscrobble.${VERSION}.tar.gz