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 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 } }