Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
frontend
Commits
35f614bc
Commit
35f614bc
authored
1 year ago
by
Tadeusz Miesiąc
Browse files
Options
Downloads
Patches
Plain Diff
chore(build on ci): build next.js docker image on ci
parent
218c9f3c
No related branches found
No related tags found
2 merge requests
!223
reset the pin numbers before search results are fetch (so the results will be...
,
!3
Development
Pipeline
#78364
failed
1 year ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+28
-38
28 additions, 38 deletions
.gitlab-ci.yml
with
28 additions
and
38 deletions
.gitlab-ci.yml
+
28
−
38
View file @
35f614bc
# This is a sample GitLab CI/CD configuration file that should run without any modifications.
# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts,
# it uses echo commands to simulate the pipeline execution.
#
# A pipeline is composed of independent jobs that run scripts, grouped into stages.
# Stages run in sequential order, but jobs within stages run in parallel.
#
# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages
#
# You can copy and paste this template into a new `.gitlab-ci.yml` file.
# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword.
#
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
default
:
default
:
image
:
node:16.16.0
image
:
node:16.16.0
variables
:
# enable docker buildkit. Used with `BUILDKIT_INLINE_CACHE=1` below
DOCKER_BUILDKIT
:
1
DOCKER_TLS_CERTDIR
:
'
/certs'
IMAGE_TEST
:
$CI_REGISTRY_IMAGE/test:latest
#IMAGE_CYPRESS: $CI_REGISTRY_IMAGE/cypress:latest
IMAGE_DEPLOY
:
$CI_REGISTRY_IMAGE/deploy:latest
stages
:
stages
:
-
lint
-
test
-
build
-
build
-
misc
-
deploy
-
deploy
cache
:
cache
:
paths
:
paths
:
-
~/.cache
-
~/.cache
variables
:
DOCKER_DRIVER
:
overlay2
lint:commit
:
.base
:
stage
:
lint
image
:
docker:latest
services
:
-
docker:dind
before_script
:
-
docker --version
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
build:builder
:
extends
:
.base
stage
:
build
script
:
script
:
-
npm install
-
docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from "$IMAGE_TEST" --target builder -t "$IMAGE_TEST" .
-
echo "${CI_COMMIT_MESSAGE}" | npx commitlint
-
docker push "$IMAGE_TEST"
deploy_staging
:
build:deployimage
:
stage
:
deploy
extends
:
.base
environment
:
staging
stage
:
misc
except
:
needs
:
[
'
build:builder'
]
-
main
script
:
script
:
-
npm install --global vercel
-
docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from "$IMAGE_DEPLOY" --cache-from "$IMAGE_TEST" --cache-from "$IMAGE_CYPRESS" -t "$IMAGE_DEPLOY" .
-
vercel pull --yes --environment=preview --token=$VERCEL_TOKEN
-
docker push "$IMAGE_DEPLOY"
-
vercel build --token=$VERCEL_TOKEN
-
vercel deploy --prebuilt --token=$VERCEL_TOKEN
rules
:
-
if
:
$CI_COMMIT_BRANCH == "develop"
when
:
never
-
if
:
$CI_COMMIT_BRANCH
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment