test build and deploy #10

Open
RaiLinKey wants to merge 10 commits from fix into test
Showing only changes of commit edb83e0fad - Show all commits

View File

@@ -20,6 +20,14 @@ jobs:
with: with:
python-version: '3.11' python-version: '3.11'
- name: Кэширование pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('api/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Установка зависимостей - name: Установка зависимостей
run: | run: |
cd api cd api
@@ -73,14 +81,23 @@ jobs:
username: ${{ secrets.REGISTRY_USERNAME }} username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }} password: ${{ secrets.REGISTRY_TOKEN }}
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('api/requirements.txt') }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build Docker image - name: Build Docker image
id: build
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: . context: .
push: false push: false
load: true load: true
tags: fastapi-app:latest tags: fastapi-app:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
- name: Stop and remove old container - name: Stop and remove old container
run: | run: |