Repository navigation
ci: add GitHub Actions pipeline for test and homologacao deploys - #17
Conversation
7439b00 to
79076ce
Compare
79076ce to
88037c2
Compare
The repository is public, so service names, tree locations and the backup directory no longer belong in the script. Read them from a settings file on the runner instead, and drop the runner label from the workflow.
Atualização: dados do servidor saíram do repositórioComo os repositórios são públicos, tudo que descreve a máquina de deploy saiu do script e passou a vir de um arquivo não rastreado no runner. Antes (versionado e público): nomes de serviço do gerenciador de processos, layout de diretórios das instâncias, diretório de backup, label do runner. Agora: o script recebe só O que continua no repositório é fato de git, não de servidor: o mapa O Passo novo de instalaçãoUma vez no runner, antes do primeiro deploy: install -Dm600 ops/deploy.env.example ~/.config/godata/deploy.env
# preencher GODATA_ROOT, GODATA_BACKUP_ROOT, GODATA_SERVICE_TESTE, GODATA_SERVICE_OPASValidado
Limite honestoIsso tira as informações do repositório. O runner self-hosted continua publicando o nome da máquina e o nome do runner no cabeçalho do log de cada execução, e log de repositório público é público. Se esconder isso também for requisito, o caminho é o deploy por pull: o servidor consulta o GitHub e roda um script que mora só nele, sem runner registrado. |
mongodump, npm and pm2 write progress to stderr, which was reaching the workflow log together with paths, the database name and the service name. Send it to a file on the host instead, and stop printing the settings path.
Both scripts truncated the same file, so the second deploy of an instance erased the output of the first.
Adds continuous integration and deployment for both instances.
Pull requests are validated on GitHub-hosted runners only. Deploys run on a self-hosted runner, so nothing triggered by a pull request can reach it, and the pipeline needs no secrets.
A push to
devdeploys to the test instance automatically. Homologacao is deployed manually from the Actions tab, with an option to mergedevintohomologacaofirst.The frontend build runs in CI and is shipped as an artifact. The deploy script preserves the per-instance local config, reinstalls dependencies when the lockfile moves, backs up Mongo before migrating, and rolls the code back if the health check fails.