fix(intent): mở rộng IN_SCOPE cho câu hỏi kiến thức sản phẩm, không d… #322
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: | |
| branches: [main] | |
| paths-ignore: | |
| - 'docs/**' | |
| - '*.md' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check Docker Hub secrets | |
| id: dockerhub | |
| run: | | |
| if [ -n "${{ secrets.DOCKERHUB_USERNAME }}" ] && [ -n "${{ secrets.DOCKERHUB_TOKEN }}" ]; then | |
| echo "enabled=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "enabled=false" >> "$GITHUB_OUTPUT" | |
| echo "::warning::Skipping release publish: missing DOCKERHUB_USERNAME and/or DOCKERHUB_TOKEN secrets." | |
| fi | |
| - name: Generate date-based version | |
| id: version | |
| run: | | |
| TODAY=$(date -u +%Y.%m.%d) | |
| # Count existing tags for today to handle multiple releases | |
| COUNT=$(git tag -l "v${TODAY}*" | wc -l | tr -d ' ') | |
| if [ "$COUNT" -eq "0" ]; then | |
| VERSION="${TODAY}" | |
| else | |
| VERSION="${TODAY}.$((COUNT + 1))" | |
| fi | |
| echo "version=${VERSION}" >> "$GITHUB_OUTPUT" | |
| echo "=== Version: v${VERSION} ===" | |
| - name: Create git tag | |
| if: steps.dockerhub.outputs.enabled == 'true' | |
| run: | | |
| git tag "v${{ steps.version.outputs.version }}" | |
| git push origin "v${{ steps.version.outputs.version }}" | |
| - name: Set up QEMU | |
| if: steps.dockerhub.outputs.enabled == 'true' | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| if: steps.dockerhub.outputs.enabled == 'true' | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| if: steps.dockerhub.outputs.enabled == 'true' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build and push app image | |
| if: steps.dockerhub.outputs.enabled == 'true' | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| build-args: VERSION=${{ steps.version.outputs.version }} | |
| tags: | | |
| buitanviet/chat-quality-agent:${{ steps.version.outputs.version }} | |
| buitanviet/chat-quality-agent:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Build and push nginx image | |
| if: steps.dockerhub.outputs.enabled == 'true' | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/Dockerfile.nginx | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| buitanviet/chat-quality-agent-nginx:${{ steps.version.outputs.version }} | |
| buitanviet/chat-quality-agent-nginx:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Create GitHub Release | |
| if: steps.dockerhub.outputs.enabled == 'true' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ steps.version.outputs.version }} | |
| generate_release_notes: true | |
| - name: Skip release summary | |
| if: steps.dockerhub.outputs.enabled != 'true' | |
| run: | | |
| echo "Release pipeline skipped because Docker Hub secrets are not configured." |