mirror of
https://github.com/vx3r/wg-gen-web.git
synced 2024-11-22 02:31:57 +01:00
42 lines
1.0 KiB
YAML
42 lines
1.0 KiB
YAML
stages:
|
|
- build artifacts
|
|
- build docker image
|
|
- push docker hub
|
|
|
|
build-back:
|
|
stage: build artifacts
|
|
image: golang:latest
|
|
script:
|
|
- GOOS=linux GOARCH=amd64 go build -o ${CI_PROJECT_NAME}-linux-amd64 -ldflags="-X 'github.com/vx3r/wg-gen-web/version.Version=${CI_COMMIT_SHA}'" github.com/vx3r/wg-gen-web/cmd/wg-gen-web
|
|
artifacts:
|
|
paths:
|
|
- ${CI_PROJECT_NAME}-linux-amd64
|
|
|
|
build-front:
|
|
stage: build artifacts
|
|
image: node:10-alpine
|
|
script:
|
|
- cd ./ui
|
|
- npm install
|
|
- npm run build
|
|
- cd ..
|
|
artifacts:
|
|
paths:
|
|
- ui/dist
|
|
|
|
build:
|
|
stage: build docker image
|
|
image: docker:latest
|
|
script:
|
|
- docker info
|
|
- docker build --build-arg COMMIT=${CI_COMMIT_SHA} --network br_docker --tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA} .
|
|
|
|
push:
|
|
stage: push docker hub
|
|
image: docker:latest
|
|
only:
|
|
- master
|
|
script:
|
|
- echo ${REGISTRY_PASSWORD} | docker login -u ${CI_REGISTRY_USER} --password-stdin ${CI_REGISTRY}
|
|
- docker push ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}
|