File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : docker-publish
2+
3+ on :
4+ push :
5+ branches : [ master, main ]
6+ tags : [ 'v*.*.*' ]
7+
8+ permissions :
9+ contents : read
10+ packages : write
11+
12+ env :
13+ REGISTRY : ghcr.io
14+ IMAGE_NAME : ${{ github.repository }}
15+
16+ jobs :
17+ build-and-push :
18+ runs-on : ubuntu-latest
19+ steps :
20+ - name : Checkout
21+ uses : actions/checkout@v4
22+
23+ - name : Set up QEMU
24+ uses : docker/setup-qemu-action@v3
25+
26+ - name : Set up Docker Buildx
27+ uses : docker/setup-buildx-action@v3
28+
29+ - name : Log in to the Container registry
30+ uses : docker/login-action@v3
31+ with :
32+ registry : ${{ env.REGISTRY }}
33+ username : ${{ github.actor }}
34+ password : ${{ secrets.GITHUB_TOKEN }}
35+
36+ - name : Extract metadata (tags, labels)
37+ id : meta
38+ uses : docker/metadata-action@v5
39+ with :
40+ images : ${{ env.REGISTRY }}/${{ toLower(env.IMAGE_NAME) }}
41+ tags : |
42+ type=ref,event=branch
43+ type=ref,event=tag
44+ type=sha
45+ type=raw,value=latest,enable={{is_default_branch}}
46+
47+ - name : Build and push
48+ uses : docker/build-push-action@v6
49+ with :
50+ context : .
51+ push : true
52+ tags : ${{ steps.meta.outputs.tags }}
53+ labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change @@ -93,7 +93,16 @@ docker build -t supportbot:latest .
9393# Persist DB to a local folder (PowerShell)
9494mkdir data
9595# Run container (maps http://localhost:8000)
96- docker run --rm -p 8000:8000 -v ${PWD} \d ata:/data -e CHATBOT_DB_PATH=/data/database.sqlite3 supportbot:latest
96+ docker run --rm -p 8000:8000 -v ${PWD} \\ data:/data -e CHATBOT_DB_PATH=/data/database.sqlite3 supportbot:latest
97+ ```
98+
99+ Or pull a published image from GHCR (after the CI publishes at least once):
100+
101+ ``` bash
102+ # Pull latest image
103+ docker pull ghcr.io/swoet/ai-driven-chatbot-python-chatterbot-:latest
104+ # Run it
105+ docker run --rm -p 8000:8000 -v ${PWD} \\ data:/data -e CHATBOT_DB_PATH=/data/database.sqlite3 ghcr.io/swoet/ai-driven-chatbot-python-chatterbot-:latest
97106```
98107
99108Stop with Ctrl+C and the DB remains in the local data folder.
You can’t perform that action at this time.
0 commit comments