diff --git a/.github/workflows/docker-cd.yaml b/.github/workflows/docker-cd.yaml new file mode 100644 index 0000000..81e2c51 --- /dev/null +++ b/.github/workflows/docker-cd.yaml @@ -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 diff --git a/.github/workflows/docker-ci.yaml b/.github/workflows/docker-ci.yaml new file mode 100644 index 0000000..5969c12 --- /dev/null +++ b/.github/workflows/docker-ci.yaml @@ -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 diff --git a/docker-compose.yaml b/docker-compose.yaml index 930292b..3cb2db5 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -28,7 +28,7 @@ services: - chatnio-network chatnio: - build: . + image: programzmh/chatnio container_name: chatnio restart: always ports: @@ -49,6 +49,8 @@ services: REDIS_PASSWORD: "" REDIS_DB: 0 SERVE_STATIC: "true" + volumes: + - ./config.yaml:/config.yaml networks: - chatnio-network