Add testing of docker image prior push
@@ -15,6 +15,7 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
+ TEST_IMAGE: ghcr.io/${{ github.repository }}:ci-test
jobs:
build-and-push-image:
@@ -56,6 +57,21 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/0.') }}
+ - name: Build and export to Docker
+ uses: docker/build-push-action@v2
+ env:
+ APP_VERSION: ${{ steps.vars.outputs.version }}
+ with:
+ context: .
+ load: true
+ tags: ${{ env.TEST_IMAGE }}
+ build-args: |
+ APP_VERSION=${{ env.APP_VERSION }}
+
+ - name: Test Docker image
+ run: |
+ docker run --rm ${{ env.TEST_IMAGE }} version
+
- name: Build and push Docker image
uses: docker/build-push-action@v2.7.0
env:
