chore(release): bump version to v1.3.0 #7
Workflow file for this run
This file contains hidden or 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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Extract version from tag | |
| id: version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Login to DockerHub | |
| uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| # Apenas TAG da imagem existente (não rebuild!) | |
| - name: Tag and push versioned image | |
| env: | |
| DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
| VERSION: ${{ steps.version.outputs.VERSION }} | |
| run: | | |
| docker pull $DOCKERHUB_USERNAME/library-api:latest | |
| docker tag $DOCKERHUB_USERNAME/library-api:latest \ | |
| $DOCKERHUB_USERNAME/library-api:$VERSION | |
| docker push $DOCKERHUB_USERNAME/library-api:$VERSION | |
| # Gera release notes automaticamente | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b | |
| with: | |
| generate_release_notes: true | |
| body: | | |
| ## 🐳 Docker Image | |
| ```bash | |
| docker pull ${{ secrets.DOCKERHUB_USERNAME }}/library-api:${{ steps.version.outputs.VERSION }} | |
| ``` | |
| ## 📦 Installation | |
| ### Docker Compose | |
| ```yaml | |
| services: | |
| library-api: | |
| image: ${{ secrets.DOCKERHUB_USERNAME }}/library-api:${{ steps.version.outputs.VERSION }} | |
| ports: | |
| - "8080:8080" | |
| environment: | |
| SPRING_PROFILES_ACTIVE: prod | |
| ``` | |
| ### Docker Run | |
| ```bash | |
| docker run -d \ | |
| -p 8080:8080 \ | |
| -e SPRING_PROFILES_ACTIVE=prod \ | |
| ${{ secrets.DOCKERHUB_USERNAME }}/library-api:${{ steps.version.outputs.VERSION }} | |
| ``` |