Deploy Fleet Management #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Fleet Management | |
on: | |
workflow_dispatch: | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Get the git deployment version | |
id: git_version | |
run: echo "GIT_DEPLOYMENT_VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./gradlew | |
- name: Clean and Install Distribution | |
run: ./gradlew clean installDist | |
- name: Build and push Fleet Deployment Image | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./deployment/build/ | |
file: ./deployment/build/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
pankalog/test-deployment:${{ env.GIT_DEPLOYMENT_VERSION }} | |
pankalog/test-deployment:latest | |
- name: Build and push Fleet Management Image | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./openremote/manager/build/install/manager/ | |
file: ./openremote/manager/build/install/manager/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
${{ secrets.DOCKER_USERNAME }}/fleet-test:${{ env.GIT_DEPLOYMENT_VERSION }} | |
${{ secrets.DOCKER_USERNAME }}/fleet-test:latest | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.GIT_DEPLOYMENT_VERSION }} | |
release_name: Release ${{ env.GIT_DEPLOYMENT_VERSION }} | |
body: | | |
## Changes | |
${{ env.COMMIT_LOG }} | |
## Docker Images | |
- [Fleet Deployment Image](https://hub.docker.com/r/{{ secrets.DOCKER_USERNAME }}/test-deployment/tags?page=1&name=${{ env.GIT_DEPLOYMENT_VERSION }}) | |
- [Fleet Management Image](https://hub.docker.com/r/{{ secrets.DOCKER_USERNAME }}/fleet-test/tags?page=1&name=${{ env.GIT_DEPLOYMENT_VERSION }}) |