Skip to content

Commit 78d54ba

Browse files
authored
Update docker-publish.yml
Signed-off-by: NxPKG <116948796+NxPKG@users.noreply.github.com>
1 parent 29790cd commit 78d54ba

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

.github/workflows/docker-publish.yml

+9-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Publish Docker Image
1+
name: Docker Compose Build and Up
22

33
on:
44
push:
@@ -9,7 +9,7 @@ on:
99
- main
1010

1111
jobs:
12-
build-and-publish:
12+
build-and-up:
1313
runs-on: ubuntu-latest
1414

1515
steps:
@@ -36,18 +36,13 @@ jobs:
3636
restore-keys: |
3737
${{ runner.os }}-buildx-
3838
39-
- name: Build and push Docker images
40-
uses: docker/build-push-action@v4
41-
with:
42-
context: .
43-
push: true
44-
tags: ${{ secrets.DOCKER_USERNAME }}/my-image:latest # Change this to your Docker image name
45-
file: ./path/to/your/Dockerfile # Adjust if you are using a specific Dockerfile
39+
- name: Build and run Docker Compose
40+
run: docker-compose -f docker-compose.yaml up --build -d
4641

47-
- name: Docker Compose Build
48-
run: docker-compose -f docker-compose.yml build
42+
- name: Run tests (optional)
43+
run: docker-compose -f docker-compose.yaml exec <service-name> <test-command> # Replace <service-name> and <test-command> with your service name and test command
4944

50-
- name: Push Docker Compose Service Images
51-
run: |
52-
docker-compose -f docker-compose.yaml push
45+
- name: Tear down Docker Compose
46+
if: always()
47+
run: docker-compose -f docker-compose.yaml down
5348

0 commit comments

Comments
 (0)