Skip to content

Commit 8933464

Browse files
update README with instructions for the GH action
1 parent 255207f commit 8933464

File tree

2 files changed

+40
-27
lines changed

2 files changed

+40
-27
lines changed

.github/workflows/docker-build.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,21 @@ jobs:
1515
permissions:
1616
contents: read
1717
packages: write
18+
strategy:
19+
matrix:
20+
variant:
21+
- name: regular
22+
file: Dockerfile
23+
suffix: ''
24+
- name: alpine
25+
file: Dockerfile-alpine
26+
suffix: '-alpine'
1827

1928
steps:
2029
- name: Checkout repository
2130
uses: actions/checkout@v4
31+
with:
32+
persist-credentials: false
2233

2334
- name: Log in to the Container registry
2435
uses: docker/login-action@v3
@@ -33,25 +44,14 @@ jobs:
3344
with:
3445
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3546
tags: |
36-
type=raw,value=latest
37-
type=raw,value={{date 'YYYYMMDD'}}
47+
type=raw,value=latest${{ matrix.variant.suffix }}
48+
type=raw,value={{date 'YYYYMMDD'}}${{ matrix.variant.suffix }}
3849
39-
- name: Build and push regular image
50+
- name: Build and push image
4051
uses: docker/build-push-action@v5
4152
with:
4253
context: .
43-
file: ./Dockerfile
54+
file: ./${{ matrix.variant.file }}
4455
push: true
4556
tags: ${{ steps.meta.outputs.tags }}
46-
labels: ${{ steps.meta.outputs.labels }}
47-
48-
- name: Build and push Alpine image
49-
uses: docker/build-push-action@v5
50-
with:
51-
context: .
52-
file: ./Dockerfile-alpine
53-
push: true
54-
tags: |
55-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:alpine
56-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:alpine-{{date 'YYYYMMDD'}}
57-
labels: ${{ steps.meta.outputs.labels }}
57+
labels: ${{ steps.meta.outputs.labels }}

README.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,30 @@ Keep track of development news:
2020

2121
Unless you wish to contribute to the project, we recommend using the hosted version at [devdocs.io](https://devdocs.io). It's up-to-date and works offline out-of-the-box.
2222

23+
### Using Docker (Recommended)
24+
25+
The easiest way to run DevDocs locally is using Docker:
26+
27+
```sh
28+
docker run --name devdocs -d -p 9292:9292 ghcr.io/freecodcamp/devdocs:latest
29+
```
30+
31+
This will start DevDocs at [localhost:9292](http://localhost:9292). We provide both regular and Alpine-based images:
32+
- `ghcr.io/freecodcamp/devdocs:latest` - Standard image
33+
- `ghcr.io/freecodcamp/devdocs:latest-alpine` - Alpine-based (smaller size)
34+
35+
Images are automatically built and updated monthly with the latest documentation.
36+
37+
Alternatively, you can build the image yourself:
38+
39+
```sh
40+
git clone https://github.com/freeCodeCamp/devdocs.git && cd devdocs
41+
docker build -t devdocs .
42+
docker run --name devdocs -d -p 9292:9292 devdocs
43+
```
44+
45+
### Manual Installation
46+
2347
DevDocs is made of two pieces: a Ruby scraper that generates the documentation and metadata, and a JavaScript app powered by a small Sinatra app.
2448

2549
DevDocs requires Ruby 3.3.0 (defined in [`Gemfile`](./Gemfile)), libcurl, and a JavaScript runtime supported by [ExecJS](https://github.com/rails/execjs#readme) (included in OS X and Windows; [Node.js](https://nodejs.org/en/) on Linux). Once you have these installed, run the following commands:
@@ -38,17 +62,6 @@ The `thor docs:download` command is used to download pre-generated documentation
3862

3963
**Note:** there is currently no update mechanism other than `git pull origin main` to update the code and `thor docs:download --installed` to download the latest version of the docs. To stay informed about new releases, be sure to [watch](https://github.com/freeCodeCamp/devdocs/subscription) this repository.
4064

41-
Alternatively, DevDocs may be started as a Docker container:
42-
43-
```sh
44-
# First, build the image
45-
git clone https://github.com/freeCodeCamp/devdocs.git && cd devdocs
46-
docker build -t thibaut/devdocs .
47-
48-
# Finally, start a DevDocs container (access http://localhost:9292)
49-
docker run --name devdocs -d -p 9292:9292 thibaut/devdocs
50-
```
51-
5265
## Vision
5366

5467
DevDocs aims to make reading and searching reference documentation fast, easy and enjoyable.

0 commit comments

Comments
 (0)