docs: описать проект для агентов в AGENTS.md #101
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 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| # Сборка проверяется и на пуллреквестах. Без этого поломка попадает в main и | |
| # обнаруживается только тем, что образ перестал собираться, а на проде | |
| # продолжает работать прежний. Так уже вышло: сборка стояла сломанной с | |
| # 3 августа. Публикацию образа это не задевает, у джобы deploy стоит | |
| # условие на push. | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: '22.x' | |
| cache: npm | |
| - name: Install | |
| run: make setup | |
| - name: Tests | |
| run: make test | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'push' }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: docker/setup-buildx-action@v4 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| push: true | |
| cache-from: ghcr.io/${{ github.repository }}:latest | |
| cache-to: type=inline | |
| tags: ghcr.io/${{ github.repository }}:latest |