Skip to content

Commit

Permalink
feat: docker ci/cd workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
zmh-program committed Dec 25, 2023
1 parent 3c68278 commit 56f0994
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/docker-cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Docker CD

on:
release:
types: [created]

jobs:

deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build the Docker image
run: docker build . --file Dockerfile --tag programzmh/chatnio:stable

- name: Push to DockerHub
run: docker push programzmh/chatnio:stable
26 changes: 26 additions & 0 deletions .github/workflows/docker-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Docker Image CI

on:
push:
branches: [ main ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build the Docker image
run: docker build . --file Dockerfile --tag programzmh/chatnio:latest

- name: Push to DockerHub
run: docker push programzmh/chatnio:latest
4 changes: 3 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
- chatnio-network

chatnio:
build: .
image: programzmh/chatnio
container_name: chatnio
restart: always
ports:
Expand All @@ -49,6 +49,8 @@ services:
REDIS_PASSWORD: ""
REDIS_DB: 0
SERVE_STATIC: "true"
volumes:
- ./config.yaml:/config.yaml
networks:
- chatnio-network

Expand Down

0 comments on commit 56f0994

Please sign in to comment.