[Feat] Discord Webhook 발송 트리거 추가 및 구조 개선 (#72) #145
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: CI | |
| on: | |
| pull_request: | |
| branches: ["main"] | |
| types: [opened, reopened, synchronize, ready_for_review] | |
| push: | |
| branches: ["main"] | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| quality-check: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup UV | |
| uses: astral-sh/setup-uv@v1 | |
| with: | |
| version: "latest" | |
| - name: Install Python 3.12 | |
| run: uv python install 3.12 | |
| - name: Install dependencies | |
| run: uv sync --all-extras --dev | |
| - name: Ruff lint | |
| run: uv run ruff check . | |
| - name: Ruff format check | |
| run: uv run ruff format --check . | |
| - name: Run pytest | |
| run: uv run pytest | |
| env: | |
| OPENAI_API_KEY: test-key-for-ci | |
| SERVICE_SECRET: test-service-secret | |
| LLM_TIMEOUT_SECONDS: "60" | |
| CALLBACK_TIMEOUT_SECONDS: "10" | |
| GOOGLE_PLACES_API_KEY: test-google-api-key | |
| publish-image: | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Resolve image tags | |
| id: meta | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| if [ -z "${{ secrets.DOCKERHUB_USERNAME }}" ]; then | |
| echo "::error::DOCKERHUB_USERNAME secret is not set" | |
| exit 1 | |
| fi | |
| repo_name="$(echo "${GITHUB_REPOSITORY##*/}" | tr '[:upper:]' '[:lower:]')" | |
| image_name="${{ secrets.DOCKERHUB_USERNAME }}/${repo_name}" | |
| sha_tag="${GITHUB_SHA}" | |
| echo "image_name=${image_name}" >> "${GITHUB_OUTPUT}" | |
| { | |
| echo "tags<<EOF" | |
| echo "${image_name}:latest" | |
| echo "${image_name}:${sha_tag}" | |
| echo "EOF" | |
| } >> "${GITHUB_OUTPUT}" | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build and push image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} |