Skip to content

Commit bd5343a

Browse files
committed
fix build workflows to run tests properly with new Dockerfile setup
1 parent 2f2303a commit bd5343a

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

.github/workflows/build-deployment-container.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,21 @@ jobs:
1212
name: Docker Push
1313
steps:
1414
- uses: actions/checkout@v3
15-
- name: Docker build
16-
run: docker build . -t metacpan/metacpan-web:$GITHUB_SHA
17-
- name: Run Perl tests
18-
run: docker run -i metacpan/metacpan-web carton exec prove -lr --jobs 2 t
1915
- name: Log in to Docker Hub
2016
uses: docker/login-action@v3
2117
with:
2218
username: ${{ secrets.DOCKER_HUB_USER }}
2319
password: ${{ secrets.DOCKER_HUB_TOKEN }}
24-
- name: Push build to Docker hub
25-
run: docker push metacpan/metacpan-web:$GITHUB_SHA
20+
- name: Build test image
21+
- uses: docker/build-push-action@v2
22+
with:
23+
tags: metacpan/metacpan-web:test
24+
target: test
25+
push: false
26+
- name: Run Perl tests
27+
run: docker run -i metacpan/metacpan-web:test
28+
- name: Build and push
29+
uses: docker/build-push-action@v5
30+
with:
31+
push: true
32+
tags: metacpan/metacpan-web:$GITHUB_SHA

.github/workflows/build-production-container.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,21 @@ jobs:
1111
name: Docker Push
1212
steps:
1313
- uses: actions/checkout@v3
14-
- name: docker build
15-
run: docker build . -t metacpan/metacpan-web:latest -t metacpan/metacpan-web:$GITHUB_SHA
16-
- name: run Perl tests
17-
run: docker run -i metacpan/metacpan-web carton exec prove -lr --jobs 2 t
1814
- name: Log in to Docker Hub
1915
uses: docker/login-action@v3
2016
with:
2117
username: ${{ secrets.DOCKER_HUB_USER }}
2218
password: ${{ secrets.DOCKER_HUB_TOKEN }}
23-
- name: Push build to Docker Hub
24-
run: docker push --all-tags metacpan/metacpan-web
19+
- name: Build test image
20+
- uses: docker/build-push-action@v2
21+
with:
22+
tags: metacpan/metacpan-web:test
23+
target: test
24+
push: false
25+
- name: Run Perl tests
26+
run: docker run -i metacpan/metacpan-web:test
27+
- name: Build and push
28+
uses: docker/build-push-action@v5
29+
with:
30+
push: true
31+
tags: metacpan/metacpan-web:latest,metacpan/metacpan-web:$GITHUB_SHA

0 commit comments

Comments
 (0)