Gitlab CI/CD Pipeline
This commit is contained in:
@@ -1,35 +1,23 @@
|
||||
stages:
|
||||
- frontend_build
|
||||
- dockerize
|
||||
|
||||
cache:
|
||||
key: ${CI_COMMIT_REF_SLUG}
|
||||
paths:
|
||||
- node_modules/
|
||||
- .next/cache/
|
||||
|
||||
variables:
|
||||
NEXT_PUBLIC_ENV: "production"
|
||||
OUTPUT_DIR: ".next"
|
||||
PROJECT_NAME: $CI_PROJECT_NAME
|
||||
DOCKER_IMAGE: $CI_REGISTRY_IMAGE
|
||||
|
||||
frontend_build_job:
|
||||
stage: frontend_build
|
||||
build_frontend:
|
||||
stage: build
|
||||
image: node:22@sha256:f6b9c31ace05502dd98ef777aaa20464362435dcc5e312b0e213121dcf7d8b95
|
||||
script:
|
||||
- cd frontend
|
||||
- npm install
|
||||
- npx next build
|
||||
- npm run lint
|
||||
- |
|
||||
cd frontend
|
||||
npm install
|
||||
npx next build
|
||||
|
||||
dockerize_frontend:
|
||||
stage: dockerize
|
||||
extends: .docker_build_template
|
||||
docker_frontend:
|
||||
extends: .docker-build-template
|
||||
variables:
|
||||
DOCKER_CONTEXT: frontend
|
||||
DOCKERFILE: Dockerfile
|
||||
DOCKER_IMAGE: $DOCKER_IMAGE
|
||||
DOCKER_BUILD_ARGS: ""
|
||||
IMAGE_NAME: frontend
|
||||
WORKDIR_PATH: frontend
|
||||
DOCKERFILE_PATH: Dockerfile
|
||||
needs:
|
||||
- job: frontend_build_job
|
||||
- build_frontend
|
||||
|
||||
@@ -22,10 +22,7 @@ const ContactFormSection = () => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState("");
|
||||
|
||||
const isDev = process.env.NODE_ENV === "development";
|
||||
const hCaptchaSiteKey = isDev
|
||||
? "10000000-ffff-ffff-ffff-000000000001" // hCaptcha test sitekey
|
||||
: "ES_ff59a664dc764f92870bf2c7b4eab7c5";
|
||||
const hCaptchaSiteKey: string = process.env.NEXT_PUBLIC_HCAPTCHA_SITE_KEY ?? "null";
|
||||
|
||||
const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
||||
setForm({...form, [e.target.name]: e.target.value});
|
||||
|
||||
Reference in New Issue
Block a user