add tmp folder cleanup #27
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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Release | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
permissions: write-all | |
strategy: | |
max-parallel: 1 | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: maven | |
- name: Bump version and push tag | |
id: github_tag_action | |
uses: anothrNick/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true | |
- name: Extract project details | |
id: extract_project_details | |
run: | | |
raw_tag=${{ steps.github_tag_action.outputs.new_tag }} | |
tag=${raw_tag:1} | |
echo "tag=$tag" >> "$GITHUB_OUTPUT" | |
artifactId=$(mvn help:evaluate "-Dexpression=project.artifactId" -q -DforceStdout) | |
echo "artifactId=$artifactId" >> "$GITHUB_OUTPUT" | |
echo "Successfully extracted artifactId $artifactId and tag $tag" | |
- name: Build with Maven | |
run: mvn -B -P docker clean package -DskipTests | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Push to DockerHub | |
run: | | |
username=${{ secrets.DOCKER_USERNAME }} | |
artifactId=${{ steps.extract_project_details.outputs.artifactId }} | |
tag=${{ steps.extract_project_details.outputs.tag }} | |
docker push "$username/$artifactId:$tag" | |
docker push "$username/$artifactId:latest" |