Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,47 @@ jobs:
id: deployment
uses: actions/deploy-pages@v4

dockerhub-release:
name: Compile and Push Docker Image
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v5

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ secrets.DOCKER_USERNAME }}/designpatternpedia

- name: Build and push Docker image
id: push
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v3
with:
subject-name: index.docker.io/${{ secrets.DOCKER_USERNAME }}/designpatternpedia
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

lighthouse:
name: Lighthouse
needs: deploy
Expand Down
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Build using the guide https://docusaurus.community/knowledge/deployment/docker/?target=dev

# Stage 1: Base image.
## Start with a base image containing NodeJS so we can build Docusaurus.
FROM node:lts AS base
## Disable colour output from yarn to make logs easier to read.
ENV FORCE_COLOR=0
## Enable corepack.
RUN corepack enable
## Set the working directory to `/opt/docusaurus`.
WORKDIR /opt/docusaurus

# Stage 2: Production build mode.
FROM base AS prod
## Set the working directory to `/opt/docusaurus`.
WORKDIR /opt/docusaurus
## Copy over the source code.
COPY . /opt/docusaurus/
## Install dependencies with `--immutable` to ensure reproducibility.
RUN npm ci
## Build the static site.
RUN npm run build

# Stage 3: Serve with `docusaurus serve`.
FROM prod AS serve
## Expose the port that Docusaurus will run on.
EXPOSE 3000
## Run the production server.
CMD ["npm", "run", "serve", "--", "--host", "0.0.0.0", "--no-open"]
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- [Build and serve](#build-and-serve)
- [Deployment](#deployment)
- [GitHub Pages](#github-pages)
- [Docker Image](#docker-image)
- [Docker](#docker)
- [Contributing](#contributing)

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
Expand Down Expand Up @@ -84,9 +84,21 @@ This step is only necessary when you want to differ from the default `baseUrl` v

T.B.A

### Docker Image
### Docker

T.B.A
The [Dockerfile](./Dockerfile) can be found in the root directory of the project. To build the Docker image _locally_, run the following command:

```bash
docker build . -t designpatternpedia
```

To then run the Docker image _locally_, use the following command:

```bash
docker run -p 3000:3000 designpatternpedia
```

The compiled image can be found on [Docker Hub at 'theartcher/designpatternpedia'](https://hub.docker.com/repository/docker/theartcher/designpatternpedia).
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'theartcher' to 'thearcher' in the Docker Hub username.

Suggested change
The compiled image can be found on [Docker Hub at 'theartcher/designpatternpedia'](https://hub.docker.com/repository/docker/theartcher/designpatternpedia).
The compiled image can be found on [Docker Hub at 'thearcher/designpatternpedia'](https://hub.docker.com/repository/docker/thearcher/designpatternpedia).

Copilot uses AI. Check for mistakes.

## Contributing

Expand Down
1 change: 1 addition & 0 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const config: Config = {
hashed: true,
indexDocs: true,
indexPages: true,
indexBlog: false,
},
],
"@docusaurus/theme-mermaid",
Expand Down