-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from blockydevs/p/release/0.2.0
Update 0.2.0
- Loading branch information
Showing
23 changed files
with
369 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
image: docker:latest | ||
services: | ||
- docker:dind | ||
|
||
stages: | ||
- build_docker | ||
- deploy | ||
|
||
variables: | ||
DOCKER_HOST: "tcp://docker:2375" | ||
DOCKER_TLS_CERTDIR: "" | ||
DOCKER_DRIVER: overlay2 | ||
RESTART_ONLY: | ||
value: "false" | ||
description: "Change to 'true' if you want to restart application only." | ||
|
||
.update_env_only_exceptions: | ||
only: | ||
variables: | ||
- $RESTART_ONLY != 'true' | ||
|
||
.docker-build: | ||
image: bentolor/docker-dind-awscli | ||
stage: build_docker | ||
tags: | ||
- docker | ||
environment: | ||
name: ${CI_COMMIT_REF_NAME} | ||
script: | ||
- cp "$DOCKER_ENV_VARIABLES" ./.env.local | ||
- docker build -t $DOCKER_REGISTRY:$DOCKER_TAG . | ||
- aws ecr get-login-password | docker login --username AWS --password-stdin $DOCKER_REGISTRY | ||
- docker push $DOCKER_REGISTRY:$DOCKER_TAG | ||
|
||
.deploy: | ||
image: registry.gitlab.com/gitlab-org/cloud-deploy/aws-base:latest | ||
stage: deploy | ||
tags: | ||
- docker | ||
environment: | ||
name: ${CI_COMMIT_REF_NAME} | ||
script: | ||
- echo "sciagam i porownuje zmienne srodowiskowe" | ||
- cp "$DOCKER_ENV_VARIABLES" ./local_$ECS_SERVICE.env | ||
- aws s3 cp s3://$AWS_DOCKER_ENV_VARIABLES_BUCKET/$ECS_SERVICE/.env aws_$ECS_SERVICE.env || touch aws_$ECS_SERVICE.env | ||
- cmp -s local_$ECS_SERVICE.env aws_$ECS_SERVICE.env || aws s3 cp local_$ECS_SERVICE.env s3://$AWS_DOCKER_ENV_VARIABLES_BUCKET/$ECS_SERVICE/.env | ||
- aws ecs update-service --cluster $ECS_CLUSTER --service $ECS_SERVICE --force-new-deployment | ||
|
||
docker-build: | ||
extends: | ||
- .update_env_only_exceptions | ||
- .docker-build | ||
only: | ||
refs: | ||
- develop | ||
- master | ||
|
||
deploy: | ||
extends: | ||
- .deploy | ||
only: | ||
refs: | ||
- develop | ||
- master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
FROM node:20-alpine AS base | ||
WORKDIR /app | ||
COPY . . | ||
RUN npm i | ||
RUN npm install -g pnpm | ||
RUN pnpm i | ||
|
||
EXPOSE 3000 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
'use client'; | ||
import Script from 'next/script'; | ||
import { env } from '@/env/env.mjs'; | ||
|
||
const GoogleTagManager: React.FC = () => { | ||
if (env.NEXT_PUBLIC_ENVIRONMENT !== 'production') { | ||
return null; | ||
} | ||
|
||
return ( | ||
<> | ||
<noscript> | ||
<iframe | ||
src={`https://www.googletagmanager.com/ns.html?id=${env.NEXT_PUBLIC_GA_ID}`} | ||
height="0" | ||
width="0" | ||
style={{ display: 'none', visibility: 'hidden' }} | ||
/> | ||
</noscript> | ||
<Script | ||
id="gtm-script" | ||
strategy="afterInteractive" | ||
dangerouslySetInnerHTML={{ | ||
__html: ` | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', '${env.NEXT_PUBLIC_GA_ID}'); | ||
` | ||
}} | ||
/> | ||
</> | ||
); | ||
}; | ||
|
||
export default GoogleTagManager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { Switch as HeadlessSwitch } from '@headlessui/react'; | ||
import { useController } from 'react-hook-form'; | ||
import { ErrorMessageForm } from '@/components/data-entry/ErrorMessageForm'; | ||
import { dictionary } from '@/libs/en'; | ||
import { cn } from '@/utils/helpers/cn'; | ||
|
||
interface SwitchProps { | ||
label?: string; | ||
name: string; | ||
disabled?: boolean; | ||
} | ||
|
||
export default function Switch({ name, label, disabled }: SwitchProps) { | ||
const { | ||
fieldState: { error }, | ||
field: { onChange, ...restField } | ||
} = useController({ name }); | ||
|
||
return ( | ||
<> | ||
<HeadlessSwitch.Group as="div" className="items-left flex gap-8 py-6"> | ||
<HeadlessSwitch | ||
{...restField} | ||
onChange={(e) => { | ||
onChange(e); | ||
}} | ||
disabled={disabled} | ||
className={cn( | ||
'border-transparent relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-teal-700 focus:ring-offset-2 ', | ||
restField.value ? 'bg-teal-600' : 'bg-transparent', | ||
disabled && 'opacity-50' | ||
)} | ||
> | ||
<span | ||
aria-hidden="true" | ||
className={cn( | ||
'pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out', | ||
restField.value ? 'translate-x-5' : 'translate-x-0' | ||
)} | ||
/> | ||
</HeadlessSwitch> | ||
{label && ( | ||
<HeadlessSwitch.Label as="div"> | ||
<div className="font-medium text-teal-600">{label}</div> | ||
</HeadlessSwitch.Label> | ||
)} | ||
</HeadlessSwitch.Group> | ||
{error && ( | ||
<ErrorMessageForm errorMessage={error.message ? error.message : dictionary.validation.defaultErrorMsg} /> | ||
)} | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.