diff --git a/.github/workflows/release-new-tag.yml b/.github/workflows/release-new-tag.yml new file mode 100644 index 00000000..9bba506f --- /dev/null +++ b/.github/workflows/release-new-tag.yml @@ -0,0 +1,31 @@ +name: Release new tag + +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: 'maven' + - name: Login to docker hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build and push docker image + run: | + mvn spring-boot:build-image -Dspring-boot.build-image.imageName=${{ secrets.DOCKER_USERNAME }}/num-portal:${{ github.ref_name }} -DskipTests + docker tag ${{ secrets.DOCKER_USERNAME }}/num-portal ${{ secrets.DOCKER_USERNAME }}/num-portal:${{ github.ref_name }} + docker push ${{ secrets.DOCKER_USERNAME }}/num-portal:${{ github.ref_name }} + + echo "### :rocket: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY