fix: remove --package flags from uv sync to install all deps #6
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: Deploy Bot | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'services/bot/**' | |
| - 'packages/byte-common/**' | |
| - 'pyproject.toml' | |
| - 'uv.lock' | |
| - '.github/workflows/deploy-bot.yml' | |
| workflow_dispatch: | |
| concurrency: | |
| group: deploy-bot-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }}-bot | |
| jobs: | |
| build-and-push: | |
| name: Build & Push | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| outputs: | |
| image: ${{ steps.meta.outputs.tags }} | |
| digest: ${{ steps.build.outputs.digest }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 | |
| - name: Log in to Container Registry | |
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=sha,prefix= | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| - name: Build and push | |
| id: build | |
| uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0 | |
| with: | |
| context: . | |
| file: services/bot/Dockerfile | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| platforms: linux/amd64 | |
| deploy: | |
| name: Deploy to Railway | |
| needs: build-and-push | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| environment: | |
| name: production | |
| steps: | |
| - name: Deploy to Railway | |
| env: | |
| RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }} | |
| run: | | |
| echo "Image: ghcr.io/${{ github.repository }}-bot:latest" | |
| echo "Digest: ${{ needs.build-and-push.outputs.digest }}" | |
| npm install -g @railway/cli | |
| if [ -n "${{ secrets.RAILWAY_BOT_SERVICE_ID }}" ]; then | |
| railway redeploy --service "${{ secrets.RAILWAY_BOT_SERVICE_ID }}" --yes | |
| else | |
| echo "::warning::RAILWAY_BOT_SERVICE_ID secret not set. Create a bot service in Railway and add the service ID." | |
| exit 1 | |
| fi |