Skip to content

Commit d92f0e1

Browse files
Merge branch 'feat/docker-images'
2 parents 401a62a + 51d6d62 commit d92f0e1

File tree

4 files changed

+3962
-2337
lines changed

4 files changed

+3962
-2337
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Dockerfile

.github/workflows/publish.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Create and publish a Docker image to GitHub Packages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- v*
9+
10+
env:
11+
IMAGE_NAME: ${{ github.repository }}
12+
13+
jobs:
14+
build-and-publish-image:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
packages: write
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Set up QEMU
25+
uses: docker/setup-qemu-action@v3
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
30+
- name: Log in to the Container registry
31+
uses: docker/login-action@v2
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Extract metadata (tags, labels) for Docker
38+
id: meta
39+
uses: docker/metadata-action@v4
40+
with:
41+
images: ghcr.io/${{ env.IMAGE_NAME }}
42+
43+
- name: Build and push Docker image
44+
uses: docker/build-push-action@v5
45+
with:
46+
context: .
47+
push: true
48+
platforms: linux/amd64,linux/arm64
49+
tags: ${{ steps.meta.outputs.tags }}
50+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Build the image. When complete, the bundled assets are available at `/project/build/`
2+
FROM node:latest AS build
3+
WORKDIR /project/
4+
COPY . .
5+
RUN npm install \
6+
&& npm run build
7+
8+
# Inject built assets into an nginx image for serving
9+
FROM nginx:latest AS app
10+
COPY --from=build /project/build /etc/nginx/html/

0 commit comments

Comments
 (0)