Skip to content

Update docker-image.yml #9

Update docker-image.yml

Update docker-image.yml #9

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 .
- name: Deploy to Kubernetes
run: microk8s kubectl apply -f /home/thomasschissler/SmartHome/deploy.yaml