Front: Fix Web Build + Improve CI (#302)
Co-authored-by: Clément Le Bihan <clement.lebihan773@gmail.com>
This commit is contained in:
@@ -27,6 +27,25 @@ jobs:
|
|||||||
|
|
||||||
## Build App ##
|
## Build App ##
|
||||||
|
|
||||||
|
Check_Front:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: ./front
|
||||||
|
environment: Staging
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Install Yarn
|
||||||
|
run: npm install -g yarn
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn install
|
||||||
|
- name: Type Check
|
||||||
|
run: yarn tsc
|
||||||
|
- name: Check Prettier
|
||||||
|
run: yarn pretty:check .
|
||||||
|
- name: Run Linter
|
||||||
|
run: yarn lint
|
||||||
|
|
||||||
Build_Front:
|
Build_Front:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
defaults:
|
defaults:
|
||||||
@@ -43,19 +62,21 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn install
|
run: yarn install
|
||||||
|
|
||||||
- name: Type Check
|
|
||||||
run: yarn tsc
|
|
||||||
- name: Check Prettier
|
|
||||||
run: yarn pretty:check .
|
|
||||||
- name: Run Linter
|
|
||||||
run: yarn lint
|
|
||||||
|
|
||||||
- name: 🏗 Setup Expo
|
- name: 🏗 Setup Expo
|
||||||
uses: expo/expo-github-action@v7
|
uses: expo/expo-github-action@v7
|
||||||
with:
|
with:
|
||||||
expo-version: latest
|
expo-version: latest
|
||||||
eas-version: 3.3.1
|
eas-version: 3.3.1
|
||||||
token: ${{ secrets.EXPO_TOKEN }}
|
token: ${{ secrets.EXPO_TOKEN }}
|
||||||
|
- name: Build Web App
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: ./front
|
||||||
|
push: false
|
||||||
|
tags: ${{steps.meta_front.outputs.tags}}
|
||||||
|
build-args: |
|
||||||
|
API_URL=${{secrets.API_URL}}
|
||||||
|
SCORO_URL=${{secrets.SCORO_URL}}
|
||||||
|
|
||||||
- name: Build Android APK
|
- name: Build Android APK
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
+2
-1
@@ -9,6 +9,7 @@ RUN yarn global add expo-cli
|
|||||||
RUN yarn global add sharp-cli
|
RUN yarn global add sharp-cli
|
||||||
|
|
||||||
COPY package.json yarn.lock ./
|
COPY package.json yarn.lock ./
|
||||||
|
RUN yarn install --immutable
|
||||||
RUN expo install
|
RUN expo install
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
@@ -17,7 +18,7 @@ ENV EXPO_PUBLIC_API_URL=$API_URL
|
|||||||
ARG SCORO_URL
|
ARG SCORO_URL
|
||||||
ENV EXPO_PUBLIC_API_URL=$SCORO_URL
|
ENV EXPO_PUBLIC_API_URL=$SCORO_URL
|
||||||
|
|
||||||
RUN yarn tsc && expo build:web
|
RUN yarn tsc && npx expo export:web
|
||||||
|
|
||||||
# Serve the app
|
# Serve the app
|
||||||
FROM nginx:1.21-alpine
|
FROM nginx:1.21-alpine
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { translate } from '../../i18n/i18n';
|
|||||||
import API from '../../API';
|
import API from '../../API';
|
||||||
import SeparatorBase from './SeparatorBase';
|
import SeparatorBase from './SeparatorBase';
|
||||||
import LinkBase from './LinkBase';
|
import LinkBase from './LinkBase';
|
||||||
import ImageBanner from '../../assets/banner.jpg';
|
import { useAssets } from 'expo-asset';
|
||||||
|
|
||||||
interface ScaffoldAuthProps {
|
interface ScaffoldAuthProps {
|
||||||
title: string;
|
title: string;
|
||||||
@@ -25,6 +25,8 @@ const ScaffoldAuth: FunctionComponent<ScaffoldAuthProps> = ({
|
|||||||
link,
|
link,
|
||||||
}) => {
|
}) => {
|
||||||
const layout = useWindowDimensions();
|
const layout = useWindowDimensions();
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
|
const [banner] = useAssets(require('../../assets/banner.jpg'));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
@@ -83,7 +85,7 @@ const ScaffoldAuth: FunctionComponent<ScaffoldAuthProps> = ({
|
|||||||
{layout.width > 650 ? (
|
{layout.width > 650 ? (
|
||||||
<View style={{ width: '50%', height: '100%', padding: 16 }}>
|
<View style={{ width: '50%', height: '100%', padding: 16 }}>
|
||||||
<Image
|
<Image
|
||||||
source={ImageBanner}
|
source={{ uri: banner?.at(0)?.uri }}
|
||||||
alt="banner page"
|
alt="banner page"
|
||||||
style={{ width: '100%', height: '100%', borderRadius: 8 }}
|
style={{ width: '100%', height: '100%', borderRadius: 8 }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Vendored
-2
@@ -1,2 +0,0 @@
|
|||||||
declare module '*.jpg';
|
|
||||||
declare module '*.png';
|
|
||||||
Reference in New Issue
Block a user