Skip to content

Commit 8fc14e2

Browse files
committed
CI: Pipeline updated add docker image build and image push to registry.
1 parent e0a7ad5 commit 8fc14e2

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,34 @@ jobs:
7272

7373
- name: Build
7474
run: pnpm build
75+
76+
docker:
77+
name: Build & Push Docker Image
78+
needs: ci
79+
runs-on: ubuntu-latest
80+
# Only push the Docker image when code is merged/pushed to the main branch
81+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
82+
83+
steps:
84+
- name: Checkout
85+
uses: actions/checkout@v4
86+
87+
- name: Set up Docker Buildx
88+
uses: docker/setup-buildx-action@v3
89+
90+
- name: Login to Docker Hub
91+
uses: docker/login-action@v3
92+
with:
93+
username: ${{ secrets.DOCKERHUB_USERNAME }}
94+
password: ${{ secrets.DOCKERHUB_TOKEN }}
95+
96+
- name: Build and push
97+
uses: docker/build-push-action@v5
98+
with:
99+
context: .
100+
push: true
101+
# Tags the image with your Docker Hub username and project name
102+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ghost-ai:latest,${{ secrets.DOCKERHUB_USERNAME }}/ghost-ai:${{ github.sha }}
103+
# The Dockerfile requires a DATABASE_URL for Prisma generate during build
104+
build-args: |
105+
DATABASE_URL=postgres://dummy:dummy@localhost:5432/dummy

0 commit comments

Comments
 (0)