diff --git a/.github/workflows/docker-image-build.yml b/.github/workflows/docker-image-build.yml new file mode 100644 index 0000000..4db7181 --- /dev/null +++ b/.github/workflows/docker-image-build.yml @@ -0,0 +1,41 @@ +name: Docker image build + +on: + push: + branches: + - master + + workflow_dispatch: + +jobs: + docker-image-build: + name: Docker image build + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push docker image + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile + push: true + tags: ghcr.io/bdeak4/chatter:${{ github.sha }},ghcr.io/bdeak4/chatter:latest + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/docker-compose.yml b/docker-compose.yml index b1769b7..8ee921b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: - .:/app restart: on-failure ports: - - 4002:5000 + - 5000:5000 env_file: - .env depends_on: