[10.1] Continuous deployment to staging and production #35
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/10.1-continuous-deployment"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add continuous deployment from Forgejo Actions using a self-hosted runner.
Changes
compose.yaml
${WEB_HOST_PORT:?WEB_HOST_PORT is required}:${WEB_PORT:-3000}Justfile
deploy targetrecipe supportingproduction/prod/mainandstaging/dev.env.production,lawnet_prod, port3410.env.staging,lawnet_staging, port3411.forgejo/workflows/deploy.yml (new)
main(production) anddev(staging)lawnet-deployenv:context to avoid YAML/shell escaping issuesalways()cleanup step.forgejo/workflows/ci.yml
WEB_HOST_PORT.gitignore
.env.productionand.env.stagingRequired Forgejo secrets
PRODUCTION_POSTGRES_PASSWORDPRODUCTION_INTERNAL_API_TOKENSTAGING_POSTGRES_PASSWORDSTAGING_INTERNAL_API_TOKENRequired runner setup
lawnet-deploy-01with labellawnet-deployCloses #34
fda2a64b56ebae747027@ -0,0 +34,4 @@WEB_PORT=3000WEB_HOST_PORT=3410INTERNAL_API_TOKEN=${INTERNAL_API_TOKEN}ENVEOFThe Postgres DB and user should be environment variables.
@ -0,0 +38,4 @@chmod 600 .env.production- name: Deployrun: just deploy productionWeb port and host port are also environment variables. All variables in the environment file should be defined as environment variables, not hardcoded in the dependency. Then they are mirrored in the .env .example files.
@ -0,0 +1,151 @@Remove this file
@ -0,0 +1,60 @@## Parent#10We moved this fileIt is a picture of.
ebae7470279fa7ef4b75@ -5,4 +5,5 @@ POSTGRES_PASSWORD=lawnet_devDATABASE_URL=postgresql://lawnet:lawnet_dev@postgres:5432/lawnetWEB_PORT=3000WEB_HOST_PORT=3406Let's use a clear dummy variable, maybe a 5-digit port number, just to make sure it's clear.
@ -89,3 +89,3 @@steps:- uses: actions/checkout@v4- run: DATABASE_URL=postgresql://localhost:5432/db POSTGRES_DB=db docker compose config- run: DATABASE_URL=postgresql://localhost:5432/db POSTGRES_DB=db WEB_HOST_PORT=3406 docker compose configLet's use a clear dummy variable, maybe a 5-digit port number, just to make sure it's clear.
@ -0,0 +12,4 @@runs-on: lawnet-deployenvironment:name: productionenv:We don't need this environment variable section anymore, do we?
@ -0,0 +54,4 @@runs-on: lawnet-deployenvironment:name: stagingenv:Same, you don't need this environment variable section in the Domino pose.
@ -49,0 +50,4 @@# Deploy to a target environment.# just deploy production (aliases: prod, main)# just deploy staging (aliases: dev)deploy target:We don't need to set the environment file and project variable rights because they're provided from the environment files, so we can remove this.
9fa7ef4b75969b11566e