chore(deps): bump docker/build-push-action from 6 to 7 #4
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*.*.*"] | ||
| permissions: | ||
| contents: write | ||
| id-token: write # Required for PyPI Trusted Publisher | ||
| jobs: | ||
| test: | ||
| name: Pre-release Tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
| - run: | | ||
| pip install -r requirements.txt | ||
| pip install pytest | ||
| pytest tests/ -v | ||
| publish-pypi: | ||
| name: Publish to PyPI | ||
| needs: test | ||
| runs-on: ubuntu-latest | ||
| environment: pypi | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
| - run: pip install build | ||
| - run: python -m build | ||
| - uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| attestations: true | ||
| docker: | ||
| name: Build & Push Docker | ||
| needs: test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: docker/setup-buildx-action@v3 | ||
| - uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
| if: secrets.DOCKERHUB_USERNAME != '' | ||
| - uses: docker/build-push-action@v7 | ||
| with: | ||
| context: . | ||
| push: ${{ secrets.DOCKERHUB_USERNAME != '' }} | ||
| tags: | | ||
| lyonzin/knowledge-rag:latest | ||
| lyonzin/knowledge-rag:${{ github.ref_name }} | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
| github-release: | ||
| name: GitHub Release | ||
| needs: [publish-pypi, docker] | ||
| if: always() && needs.publish-pypi.result == 'success' | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Generate changelog | ||
| id: changelog | ||
| run: | | ||
| PREV_TAG=$(git tag --sort=-creatordate | sed -n '2p') | ||
| if [ -z "$PREV_TAG" ]; then PREV_TAG=$(git rev-list --max-parents=0 HEAD); fi | ||
| echo "## Changes since $PREV_TAG" > /tmp/changelog.md | ||
| git log ${PREV_TAG}..HEAD --pretty=format:"- %s" >> /tmp/changelog.md | ||
| - uses: softprops/action-gh-release@v2 | ||
| with: | ||
| body_path: /tmp/changelog.md | ||
| generate_release_notes: true | ||