Bump tj-actions/changed-files from 44 to 46 in /.github/workflows (#1… #95
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: Docker Push | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| defaults: | |
| run: | |
| working-directory: ./autorag | |
| env: | |
| DOCKER_REPO: "autoraghq/autorag" | |
| jobs: | |
| check-version: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| changed: ${{ steps.version_changed.outputs.changed }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4.2.0 | |
| - name: Get changed files | |
| id: changed-files | |
| uses: tj-actions/changed-files@v46 | |
| - name: Check for VERSION file change | |
| id: version_changed | |
| env: | |
| ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | |
| run: | | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| if echo "${ALL_CHANGED_FILES}" | grep -q 'VERSION'; then | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| build-and-push: | |
| needs: check-version | |
| if: needs.check-version.outputs.changed == 'true' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| variant: [gpu, gpu-parsing] # [ko, ja, dev, parsing, api] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4.2.0 | |
| - name: Read VERSION file | |
| run: echo "VERSION=$(cat autorag/VERSION)" >> $GITHUB_ENV | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3.7.1 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3.3.0 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5.5.1 | |
| with: | |
| images: ${{ env.DOCKER_REPO }} | |
| tags: | | |
| type=raw,value=${{ env.VERSION }}-${{ matrix.variant }} | |
| type=raw,value=${{ matrix.variant }},enable=${{ github.ref == format('refs/heads/{0}', 'main') }} | |
| type=raw,value=latest-${{ matrix.variant }},enable=${{ github.ref == format('refs/heads/{0}', 'main') }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6.9.0 | |
| with: | |
| context: . | |
| file: ./Dockerfile.gpu | |
| push: true | |
| # push: ${{ github.event_name != 'pull_request' && matrix.variant != 'test' }} | |
| tags: ${{ env.DOCKER_REPO }}:${{matrix.variant}}-${{ env.VERSION }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| TARGET_STAGE=${{ matrix.variant }} | |
| - name: Tag and push 'all' for production | |
| run: | | |
| docker pull ${{ env.DOCKER_REPO }}:${{matrix.variant}}-${{ env.VERSION }} | |
| docker tag ${{ env.DOCKER_REPO }}:${{matrix.variant}}-${{ env.VERSION }} ${{ env.DOCKER_REPO }}:${{matrix.variant}}-latest | |
| docker push ${{ env.DOCKER_REPO }}:${{matrix.variant}}-${{ env.VERSION }} | |
| docker push ${{ env.DOCKER_REPO }}:${{matrix.variant}}-latest | |
| # - name: Update Docker Hub description | |
| # uses: peter-evans/dockerhub-description@v3 | |
| # with: | |
| # username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| # password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
| # repository: ${{ env.DOCKER_REPO }} | |
| # short-description: ${{ github.event.repository.description }} |