Update README and run-pr-review script for Xianix Team documentation … #1
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: Publish Docker Image | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" # triggers on version tags: v1.0.0, v2.3.1, etc. | |
| env: | |
| IMAGE_NAME: xianix-pr-review-agent | |
| jobs: | |
| build-and-push: | |
| name: Build & push to Docker Hub | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Extract version from tag | |
| id: meta | |
| run: | | |
| TAG="${GITHUB_REF_NAME}" # e.g. v1.2.3 | |
| VERSION="${TAG#v}" # strip leading 'v' → 1.2.3 | |
| MAJOR="${VERSION%%.*}" # → 1 | |
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "major=$MAJOR" >> "$GITHUB_OUTPUT" | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| # Tags published: | |
| # org/image:1.2.3 — exact version (immutable) | |
| # org/image:1 — major-version floating tag | |
| # org/image:latest — always the newest release | |
| tags: | | |
| ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} | |
| ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.major }} | |
| ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest | |
| # Layer cache — reuses cached layers across tag builds | |
| cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:buildcache | |
| cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:buildcache,mode=max | |
| labels: | | |
| org.opencontainers.image.title=Xianix PR Review Agent | |
| org.opencontainers.image.version=${{ steps.meta.outputs.version }} | |
| org.opencontainers.image.revision=${{ github.sha }} | |
| org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} |