Commit d462aa3 1 parent 4522070 commit d462aa3 Copy full SHA for d462aa3
File tree 8 files changed +37
-7
lines changed
8 files changed +37
-7
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ inputs:
19
19
dockerfile :
20
20
description : ' Path to the Dockerfile'
21
21
required : true
22
+ context :
23
+ description : ' Path to the Context'
24
+ default : .
25
+ required : true
22
26
build-args :
23
27
description : ' List of build-time variables'
24
28
required : false
65
69
uses : docker/build-push-action@v4
66
70
id : publish
67
71
with :
68
- context : .
72
+ context : ${{ inputs.context }}
69
73
file : ${{ inputs.dockerfile }}
70
74
push : true
71
75
tags : ${{ steps.meta.outputs.tags }}
Original file line number Diff line number Diff line change 30
30
password : ${{ secrets.GITHUB_TOKEN }}
31
31
image : ghcr.io/fuellabs/fuel-explorer
32
32
dockerfile : deployment/Dockerfile
33
+ context : ./packages/graphql
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ FROM node:20-slim AS base
4
4
5
5
# Expose the ENVs to the env of the container
6
6
ENV PORT="${PORT}"
7
- ENV FUEL_PROVIDER_BETA5 ="${FUEL_PROVIDER_BETA5 }"
7
+ ENV FUEL_PROVIDER ="${FUEL_PROVIDER:-https://beta-5.fuel.network/graphql }"
8
8
ENV PNPM_HOME="/pnpm"
9
9
ENV PATH="$PNPM_HOME:$PATH"
10
10
@@ -14,10 +14,10 @@ RUN corepack enable
14
14
COPY . /app-explorer
15
15
WORKDIR /app-explorer
16
16
17
- RUN pnpm install --frozen-lockfile
17
+ RUN pnpm install
18
18
19
19
EXPOSE ${PORT}
20
20
21
- WORKDIR /app-explorer/packages/graphql
21
+ WORKDIR /app-explorer
22
22
23
- CMD ["pnpm" , "start" ]
23
+ CMD ["pnpm" , "server: start" ]
Original file line number Diff line number Diff line change 1
1
import { createExecutor , createSchema } from '@fuel-explorer/graphql' ;
2
2
import { ContextDomain } from '@fuel-explorer/graphql/src/domains/Context' ;
3
3
import { createYoga } from 'graphql-yoga' ;
4
+ import { requireEnv } from '~/systems/utils/requireEnv' ;
5
+
6
+ const { FUEL_PROVIDER_BETA5 : url } = requireEnv ( [ 'FUEL_PROVIDER_BETA5' ] ) ;
4
7
5
- const url = process . env . FUEL_PROVIDER_BETA5 ! ;
6
8
const executor = createExecutor ( async ( { body } ) => {
7
9
return fetch ( url , {
8
10
body,
Original file line number Diff line number Diff line change
1
+ export function requireEnv <
2
+ A extends string [ ] ,
3
+ B extends { [ key in A [ number ] ] : string } ,
4
+ > ( keys : string [ ] ) : B {
5
+ return keys . reduce ( ( ret , key ) => {
6
+ if ( ! process . env [ key ] ) {
7
+ throw new Error ( `Environment variable ${ key } is required` ) ;
8
+ }
9
+ ret [ key ] = process . env [ key ] ! ;
10
+ return ret ;
11
+ } , { } as B ) ;
12
+ }
Original file line number Diff line number Diff line change 10
10
"typings" : " ./src/index.ts" ,
11
11
"scripts" : {
12
12
"build" : " run-s codegen:fuel build:lib" ,
13
- "build:lib" : " tsup --dts " ,
13
+ "build:lib" : " tsup" ,
14
14
"build:watch" : " pnpm build:lib --watch" ,
15
15
"codegen:fuel" : " gql-gen -r dotenv/config --config codegen.fuel.ts" ,
16
16
"codegen:app" : " gql-gen -r dotenv/config --config codegen.ts" ,
17
17
"dev" : " pnpm build:watch" ,
18
+ "server:start" : " node ./dist/index.js" ,
18
19
"fix:generated" : " node ./scripts/fix-generated.mjs" ,
19
20
"ts:check" : " tsc --noEmit" ,
20
21
"prepare" : " pnpm build"
63
64
"execa" : " 8.0.1" ,
64
65
"graphql-codegen-typescript-common" : " 0.18.2" ,
65
66
"graphql-codegen-typescript-mock-data" : " 3.7.1" ,
67
+ "npm-run-all" : " ^4.1.5" ,
66
68
"tsconfig-paths" : " ^4.2.0" ,
69
+ "tsup" : " 8.0.1" ,
67
70
"tsx" : " 4.7.0"
68
71
}
69
72
}
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ export default defineConfig((options) => ({
13
13
format : [ 'esm' , 'cjs' ] ,
14
14
sourcemap : true ,
15
15
clean : false ,
16
+ dts : false ,
17
+ minify : false ,
16
18
esbuildPlugins : [ graphqlLoaderPlugin ( ) ] ,
17
19
entry : { index : 'src/bin/index.ts' } ,
18
20
async onSuccess ( ) {
You can’t perform that action at this time.
0 commit comments