feat(cd): build image and use it in docker compose
This commit is contained in:
28
.github/workflows/docker-build.yml
vendored
Normal file
28
.github/workflows/docker-build.yml
vendored
Normal file
@@ -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
|
||||||
@@ -25,9 +25,7 @@ services:
|
|||||||
- lbf-network
|
- lbf-network
|
||||||
|
|
||||||
discord-bot:
|
discord-bot:
|
||||||
build:
|
image: pihkaal/lbf-bot-discord-bot:latest
|
||||||
context: .
|
|
||||||
dockerfile: apps/discord-bot/Dockerfile
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
|
|||||||
Reference in New Issue
Block a user