Add Docker build workflow #35
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: Build and Publish to GHCR | |
| on: | |
| push: | |
| branches: | |
| - master | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.12' # <-- теперь 3.12 | |
| - name: Upgrade pip and install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install --no-cache-dir -r requirements.txt | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build Docker image | |
| run: | | |
| docker build -t ghcr.io/${{ github.repository_owner }}/secretai-chat:v2 . | |
| - name: Push to GHCR | |
| run: | | |
| docker push ghcr.io/${{ github.repository_owner }}/secretai-chat:v2 |