-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (26 loc) · 992 Bytes
/
docker-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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