Skip to content

Commit

Permalink
chore: change web dist directory
Browse files Browse the repository at this point in the history
  • Loading branch information
aseerkt committed Aug 13, 2024
1 parent 33cbb85 commit d7fc14e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/ec2-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ jobs:
uses: actions/download-artifact@v4
with:
name: mchat_build

- name: Move static files
run: |
sudo rm -rf server/web/dist/*
sudo mv web/dist/* server/web/dist
rm -rf server/src

- name: Restart application
run: pm2 restart mchat
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ FROM base AS app
WORKDIR /prod/app

COPY --from=build /prod/server .
COPY --from=build /prod/web/dist ./web/dist
COPY --from=build /prod/web .

RUN pnpm swag:gen

Expand Down
1 change: 1 addition & 0 deletions infra/ec2/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@ cp ./Caddyfile /etc/caddy/Caddyfile

./docker-up.sh

# setup action runner
# configure env file by hand
# make pm2 available in github actions - https://stackoverflow.com/a/72030074/10240723
2 changes: 1 addition & 1 deletion server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const createApp = async () => {
app.use(errorHandler)

if (config.isProd) {
const webStaticPath = path.join(__dirname, '..', 'web', 'dist')
const webStaticPath = path.join(__dirname, '..', '..', 'web', 'dist')
app.use(express.static(webStaticPath))
app.get('*', (_req, res) => {
res.sendFile(path.join(webStaticPath, 'index.html'))
Expand Down

0 comments on commit d7fc14e

Please sign in to comment.