Skip to content

Commit 39b6897

Browse files
committed
try building and testing in the same job
1 parent 7c0c60d commit 39b6897

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

.github/workflows/deploy-image.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ on:
55

66
env:
77
REGISTRY: ghcr.io
8-
IMAGE_NAME: cosmostat/shapepipe
8+
IMAGE_NAME: ${{ github.repository }}
9+
BRANCH: ${{ github.ref }}
910

1011
jobs:
1112
build-and-push-image:
@@ -24,32 +25,28 @@ jobs:
2425
username: ${{ github.actor }}
2526
password: ${{ secrets.GITHUB_TOKEN }}
2627

28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
2731
- name: Extract metadata (tags, labels) for Docker
2832
id: meta
2933
uses: docker/metadata-action@v5
3034
with:
3135
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3236

33-
- name: Build and push Docker image
37+
- name: Build and export to Docker
3438
uses: docker/build-push-action@v6
3539
with:
36-
push: true
40+
load: true
3741
tags: ${{ steps.meta.outputs.tags }}
3842
labels: ${{ steps.meta.outputs.labels }}
43+
44+
- name: Test
45+
run: docker run --rm ${{ steps.meta.outputs.tags }} shapepipe_run -c /app/example/config.ini
3946

40-
test-shapepipe-image:
41-
runs-on: ubuntu-latest
42-
needs: build-and-push-image
43-
steps:
44-
- name: Log in to the Container registry
45-
uses: docker/login-action@v3
47+
- name: Push
48+
uses: docker/build-push-action@v6
4649
with:
47-
registry: ${{ env.REGISTRY }}
48-
username: ${{ github.actor }}
49-
password: ${{ secrets.GITHUB_TOKEN }}
50-
51-
- name: Pull Docker Image
52-
run: docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
53-
54-
- name: Test Shapepipe
55-
run: docker run --rm ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest shapepipe_run -c /app/example/config.ini
50+
push: true
51+
tags: ${{ steps.meta.outputs.tags }}
52+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)