Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Commit

Permalink
Add Docker configuration and build process***
Browse files Browse the repository at this point in the history
***Archive and download metadata during CI/CD***

***Update package.json with optional dependencies
  • Loading branch information
maxmielchen committed Feb 13, 2024
1 parent 7188e23 commit 6f14253
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.git/
.parcel-cache/
dist/
node_modules/
.gitignore
package-lock.json
readme.md
16 changes: 13 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- id: meta
name: Extract metadata
uses: docker/metadata-action@v5.0.0
with:
images: ghcr.io/${{ github.repository }}/stft
- name: Archive metadata
uses: actions/upload-artifact@v2
with:
name: metadata
path: .docker

build_and_push:
name: Build and Push
Expand All @@ -82,13 +88,17 @@ jobs:
with:
name: source-code
path: .


- name: Download metadata
uses: actions/download-artifact@v2
with:
name: metadata
path: .docker

- name: Push to GHCR
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ needs.metadata.steps.meta.outputs.tags }}
labels: ${{ needs.metadata.steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:20.11.0 as builder

COPY . .
RUN npm install
RUN npm run build

FROM nginx:1.24.3

COPY --from=builder /dist /usr/share/nginx/html
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@
"react": "^18.2.0",
"react-bootstrap": "^2.10.0",
"react-dom": "^18.2.0"
},
"optionalDependencies": {
"@parcel/watcher-linux-x64-glibc": "^2.4.0",
"@parcel/watcher-linux-arm64-glibc": "^2.4.0"
}
}

0 comments on commit 6f14253

Please sign in to comment.