From 3c7ab6e3d0848c8b8fa5e51a81e1521c439876b9 Mon Sep 17 00:00:00 2001 From: Christian Landgren Date: Wed, 18 Sep 2024 12:03:45 +0200 Subject: [PATCH 1/2] fix: add build script to docker file --- Dockerfile | 1 + api/server.ts | 1 + package.json | 2 +- tsconfig.json | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c464d1d..e0ccd44 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,4 +5,5 @@ RUN npm install --omit=dev RUN npm install -g ts-node COPY . . EXPOSE 3000 +RUN npm run build CMD ["ts-node", "api/server.ts"] \ No newline at end of file diff --git a/api/server.ts b/api/server.ts index 73bbf81..a15c2c1 100644 --- a/api/server.ts +++ b/api/server.ts @@ -23,6 +23,7 @@ const io = new Server(server, { }, }) +app.use('/', express.static(path.join(__dirname, '../dist'))) app.use('/assets', express.static(path.join(__dirname, '../assets'))) app.get('/healthz', (req, res) => res.send('ok')) diff --git a/package.json b/package.json index fda446f..be3e684 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "android": "expo start --android", "ios": "expo start --ios", "web": "expo start --web", - "serve": "expo export && npx serve dist -p 3000", + "build": "expo export", "deploy": "gh-pages -d dist", "predeploy": "expo export && echo skaff.iteam.pub > dist/CNAME" }, diff --git a/tsconfig.json b/tsconfig.json index b9567f6..340e8b1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "expo/tsconfig.base", "compilerOptions": { - "strict": true + "strict": false } } From b643f3a2068b00bc4e510b7aa8ff5e21506d3a17 Mon Sep 17 00:00:00 2001 From: Christian Landgren Date: Wed, 18 Sep 2024 12:08:26 +0200 Subject: [PATCH 2/2] fix: use github token --- .github/workflows/gh-pages.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 4d793fe..bf63fb8 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -1,14 +1,8 @@ name: Publish to Github Pages -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - on: push: branches: ['main'] - # Publish semver tags as releases. tags: ['v*.*.*'] jobs: @@ -25,9 +19,11 @@ jobs: run: npm install - name: Git user config - run: git config --global user.email "registry@iteam.se" - - name: Git user config - run: git config --global user.name "ghpages bot" + run: | + git config --global user.email "registry@iteam.se" + git config --global user.name "ghpages bot" - name: Publish to Github Pages + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: npm run deploy