Une collection organisée de snippets de code pour accélérer votre développement. Parcourez, recherchez et copiez en un clic.
build_job:
stage: build
script:
- npm run build
artifacts:
paths:
- build/
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
include:
- local: '/.gitlab-ci-templates.yml'
deploy_prod:
stage: deploy
script:
- echo "Deploying to production"
when: manual
test:
script: npm test
parallel:
matrix:
- PROVIDER: aws
STACK:
- monitoring
- app
- PROVIDER: gcp
stages:
- build
- test
build_job:
stage: build
script:
- echo "Building..."
test_job:
stage: test
script:
- echo "Testing..."
deploy_job:
stage: deploy
script: deploy.sh
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
test_job:
stage: test
services:
- postgres:14.5
script:
- run_integration_tests.sh
default:
image: node:18-alpine
build_job:
script:
- npm install
- npm run build
variables:
NODE_ENV: production
build_job:
script:
- echo "Building for $NODE_ENV"