feature/teacher-quiz-form #1
@@ -10,8 +10,19 @@ on:
|
|||||||
# checkout path — otherwise `docker compose` would derive the project name
|
# checkout path — otherwise `docker compose` would derive the project name
|
||||||
# from the checkout directory, potentially spinning up a second stack and
|
# from the checkout directory, potentially spinning up a second stack and
|
||||||
# losing the `pgdata` volume instead of updating the running one.
|
# losing the `pgdata` volume instead of updating the running one.
|
||||||
|
#
|
||||||
|
# JWT_SECRET/POSTGRES_PASSWORD come from Gitea's own Actions secrets store
|
||||||
|
# rather than the `.env` file DEPLOY.md has the human create in
|
||||||
|
# `/opt/ruvdstests` — the job checks out into the runner's own workspace, not
|
||||||
|
# that directory, so there's no `.env` for `docker compose` to read here.
|
||||||
|
# Must match the values already in that `.env` file: on `Deploy` this
|
||||||
|
# `docker compose up -d` targets the same running project (via
|
||||||
|
# COMPOSE_PROJECT_NAME above), and a different POSTGRES_PASSWORD than what
|
||||||
|
# the live `pgdata` volume was initialized with breaks the DB connection.
|
||||||
env:
|
env:
|
||||||
COMPOSE_PROJECT_NAME: ruvdstests
|
COMPOSE_PROJECT_NAME: ruvdstests
|
||||||
|
JWT_SECRET: ${{ secrets.JWT_SECRET }}
|
||||||
|
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-test-deploy:
|
build-test-deploy:
|
||||||
|
|||||||
@@ -46,6 +46,16 @@ node in PATH` раньше, чем успевает выполниться чт
|
|||||||
Проверить, что раннер подключился: Site Administration → Actions → Runners — должен появиться
|
Проверить, что раннер подключился: Site Administration → Actions → Runners — должен появиться
|
||||||
`ruvdstest-prod` со статусом Idle/Online.
|
`ruvdstest-prod` со статусом Idle/Online.
|
||||||
|
|
||||||
|
## Секреты
|
||||||
|
|
||||||
|
Джоб чекаутит репозиторий во временную директорию раннера, а не в `/opt/ruvdstests` — своего
|
||||||
|
`.env` там нет, поэтому `JWT_SECRET`/`POSTGRES_PASSWORD` для `docker compose build`/`up` берутся не
|
||||||
|
из файла, а из хранилища секретов самой Gitea Actions: Settings репозитория → Actions → Secrets →
|
||||||
|
**Add Secret**. Завести `JWT_SECRET` и `POSTGRES_PASSWORD` со **значениями, совпадающими с тем, что
|
||||||
|
уже лежит в `/opt/ruvdstests/.env`** на сервере (`cat /opt/ruvdstests/.env` на сервере, скопировать
|
||||||
|
оттуда) — деплой-шаг пересоздаёт тот же самый запущенный проект (`COMPOSE_PROJECT_NAME` выше), и
|
||||||
|
рассинхронизация паролей с уже инициализированным `pgdata`-volume сломает подключение к БД.
|
||||||
|
|
||||||
## Проверка
|
## Проверка
|
||||||
|
|
||||||
Сделайте любой коммит и запушьте в `master` — во вкладке **Actions** репозитория должен появиться
|
Сделайте любой коммит и запушьте в `master` — во вкладке **Actions** репозитория должен появиться
|
||||||
|
|||||||
Reference in New Issue
Block a user