Skip to content

Update docker-image.yml #8

Update docker-image.yml

Update docker-image.yml #8

Workflow file for this run

name: TestService Docker Image CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v3
- name: Set Version Environment Variable
env:
VERSION: ${{ github.event_name == 'release' && github.ref == 'refs/tags/v*' && github.event.release.tag_name }}
run: |
# Use GitHub Actions context to set the VERSION environment variable.
if [ -n "$VERSION" ]; then
echo "Version is $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
fi
- name: Build and publish Docker image
run: |
# Build the Docker image with the package version tag.
docker build -t tschissler/testservice:${VERSION} -t tschissler/testservice:latest -f ./TestService/Dockerfile --push .