Skip to content

Commit

Permalink
Build on-the-metal
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Nov 29, 2023
1 parent d6c57e6 commit 4bdaa83
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
3 changes: 0 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

/data

Expand Down
33 changes: 32 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,37 @@ jobs:
runs-on: ubuntu-22.04

steps:
- name: Git checkout
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 21
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
id: pnpm
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Test
run: pnpm run test
- name: Build
run: pnpm run build

- name: Decide image tags
id: info
shell: python
Expand Down Expand Up @@ -78,7 +109,7 @@ jobs:
if: (github.event_name == 'push' || github.event_name == 'release')
with:
context: .
file: ./Dockerfile
file: ./dist.Dockerfile
tags: ${{ steps.info.outputs.tags_csv }}
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7,linux/ppc64le
push: ${{ steps.info.outputs.push }}
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Build in Docker

FROM docker.io/library/node:21.2.0-alpine3.18 AS build

# See https://pnpm.io/docker
Expand Down
8 changes: 8 additions & 0 deletions dist.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Build on-the-metal, deploy using Docker

FROM docker.io/library/caddy:2.7.5-alpine
COPY ./Caddyfile /etc/caddy/Caddyfile
COPY ./dist /app/dist

EXPOSE 2019 8080
CMD ["caddy", "run", "-c", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]

0 comments on commit 4bdaa83

Please sign in to comment.