diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..854b695 --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,28 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker image + run: | + docker build -t pihkaal/lbf-bot-discord-bot:latest -f apps/discord-bot/Dockerfile . + docker push pihkaal/lbf-bot-discord-bot:latest diff --git a/docker-compose.yml b/docker-compose.yml index 2111d40..119cb32 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,9 +25,7 @@ services: - lbf-network discord-bot: - build: - context: . - dockerfile: apps/discord-bot/Dockerfile + image: pihkaal/lbf-bot-discord-bot:latest restart: unless-stopped depends_on: postgres: