Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tschissler authored Sep 19, 2023
1 parent fc7d0ff commit 4c84563
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ jobs:

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 .
docker build -t tschissler/testservice:${{ github.sha }} -t tschissler/testservice:latest -f ./TestService/Dockerfile --push .
- name: Bump version and push tag
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
DEFAULT_BUMP: patch

- name: Update Kubernetes deployment
run: |
kubectl set tschissler/testservice your-testservice=tschissler/testservice:${{ steps.bump.outputs.newTag }}
- name: Deploy to Kubernetes
run: microk8s kubectl apply -f /home/thomasschissler/SmartHome/deploy.yaml

0 comments on commit 4c84563

Please sign in to comment.