Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunagatov committed Feb 4, 2024
1 parent ae1cd28 commit 71f7b77
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 27 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/dev-branch-pr-deployment-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ on:

env:
ENV_FILE_NAME: .frontend_env
ENV_FILE_PATH_IN_PRIVATE_REPOSITORY: ./Vault/IcedLatte/Frontend/.frontend_env
DOCKER_COMPOSE_FILE: docker-compose.yml
DOCKER_CONTAINER_NAME: latte-frontend
DOCKER_IMAGE_NAME: iced-latte-frontend
DOCKER_HUB_ACCOUNT_NAME: zufarexplainedit
ICED_LATTE_PATH_ON_THE_REMOTE_SERVER: /opt/project/Iced-Latte
APP_PATH_ON_THE_REMOTE_SERVER: /opt/project/Iced-Latte

jobs:
Expand All @@ -24,16 +22,6 @@ jobs:
- name: Checkout source code from the repository
uses: actions/checkout@v4

- name: Clone the .env file from private repository (vault)
uses: actions/checkout@v4
with:
repository: Sunagatov/Vault
token: ${{ secrets.PRIVATE_REPO_ACCESS_TOKEN }}
path: Vault

- name: Copy the .env file to the workspace
run: cp $ENV_FILE_PATH_IN_PRIVATE_REPOSITORY ./

- name: Set DOCKER_IMAGE_TAG
run: echo "DOCKER_IMAGE_TAG=$GITHUB_REF_NAME-${GITHUB_SHA:0:7}" >> $GITHUB_ENV

Expand Down Expand Up @@ -67,11 +55,6 @@ jobs:
key: ${{ secrets.DEV_SSH_PRIV_KEY }}
envs: DOCKER_IMAGE_TAG
script: |
cd ${{ env.ICED_LATTE_PATH_ON_THE_REMOTE_SERVER }}
rm -rf Vault
git clone https://${{ secrets.PRIVATE_REPO_ACCESS_TOKEN }}:[email protected]/Sunagatov/Vault.git
rm ${{ env.APP_PATH_ON_THE_REMOTE_SERVER }}/${{ env.ENV_FILE_NAME }}
cp ${{ env.ICED_LATTE_PATH_ON_THE_REMOTE_SERVER }}/Vault/IcedLatte/Frontend/${{ env.ENV_FILE_NAME }} ${{ env.APP_PATH_ON_THE_REMOTE_SERVER }}/${{ env.ENV_FILE_NAME }}
cd ${{ env.APP_PATH_ON_THE_REMOTE_SERVER }}
docker-compose -f ${{ env.DOCKER_COMPOSE_FILE }} down ${{ env.DOCKER_CONTAINER_NAME }}
docker-compose -f ${{ env.DOCKER_COMPOSE_FILE }} up -d ${{ env.DOCKER_CONTAINER_NAME }}
7 changes: 2 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3.5"
version: "3.9"

networks:
iced-latte-network:
Expand All @@ -8,12 +8,9 @@ networks:
services:
iced-latte-frontend:
image: 'zufarexplainedit/iced-latte-frontend:${DOCKER_IMAGE_TAG}'
container_name: iced-latte-frontend
env_file:
- .frontend_env
container_name: latte-frontend
build:
context: .
dockerfile: Dockerfile
restart: 'always'
networks:
- iced-latte-network
10 changes: 5 additions & 5 deletions src/utils/getImgUrl.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { StaticImageData } from 'next/image'

const MINIO_URL_STUB = 'default file'
const DEFAULT_STATIC_FILE_URL_VALUE = 'default file'

export default function getImgUrl(
minioUrl: string | null,
staticFileUrl: string | null,
localImage: StaticImageData,
): string | StaticImageData {
if (typeof minioUrl === 'string' && minioUrl != MINIO_URL_STUB) {
// Uncomment out when img loading optimization is ready IL-263
// return minioUrl

if (typeof staticFileUrl === 'string' && staticFileUrl != DEFAULT_STATIC_FILE_URL_VALUE) {
return staticFileUrl
}

return localImage
Expand Down

0 comments on commit 71f7b77

Please sign in to comment.