File tree Expand file tree Collapse file tree 2 files changed +72
-17
lines changed Expand file tree Collapse file tree 2 files changed +72
-17
lines changed Original file line number Diff line number Diff line change 88jobs :
99 deploy :
1010 runs-on : ubuntu-latest
11-
1211 steps :
13- - name : Git checkout
14- uses : actions/checkout@v3
15- with :
16- fetch-depth : 0
17-
18- # See the following link for documentation:
19- # https://github.com/marketplace/actions/dokku
20- - name : Push to hermes
21- 22- with :
23- ssh_private_key : ${{ secrets.HERMES_GLOBAL_DEPLOY_KEY }}
24- git_remote_url :
ssh://[email protected] /cashflow 25- # force might feel risky, but there is no good reason why the server
26- # should ever not be a mirror of the deploy branch. And the errors we
27- # could get otherwise would probably be nasty to deal with
28- git_push_flags : --force
12+ - name : Deploy to Nomad
13+ uses : datasektionen/nomad-deploy@v1
14+ with :
15+ github-token : ${{ secrets.GITHUB_TOKEN }}
16+ nomad-token : ${{ secrets.NOMAD_TOKEN }}
17+ nomad-addr : ${{ vars.NOMAD_ADDR }}
Original file line number Diff line number Diff line change 1+ job "cashflow" {
2+ namespace = " money"
3+
4+ type = " service"
5+
6+ group "cashflow" {
7+ network {
8+ port "http" {
9+ to = 8000 # hardcoded in Dockerfile
10+ }
11+ }
12+
13+ service {
14+ name = " cashflow"
15+ port = " http"
16+ provider = " nomad"
17+ tags = [
18+ " traefik.enable=true" ,
19+ " traefik.http.routers.cashflow.rule=Host(`cashflow.datasektionen.se`)" ,
20+ " traefik.http.routers.cashflow.tls.certresolver=default" ,
21+ ]
22+ }
23+
24+ task "cashflow" {
25+ driver = " docker"
26+
27+ config {
28+ image = var. image_tag
29+ ports = [" http" ]
30+ }
31+
32+ template {
33+ data = << ENV
34+ {{ with nomadVar "nomad/jobs/cashflow" }}
35+ DATABASE_URL=postgres://cashflow:{{ .db_password }}@postgres.dsekt.internal:5432/cashflow
36+ SECRET_KEY={{ .secret_key }}
37+ LOGIN_KEY={{ .login_key }}
38+ SPAM_API_KEY={{ .spam_api_key }}
39+ S3_HOST={{ .s3_host }}
40+ S3_BUCKET_NAME={{ .s3_bucket }}
41+ S3_ACCESS_KEY_ID={{ .s3_access_key_id }}
42+ S3_SECRET_ACCESS_KEY={{ .s3_secret_access_key }}
43+ {{ end }}
44+ S3_USE_SIGV4=False
45+ GOOGLE_ANALYTICS_KEY=UA-96183461-2
46+ DEBUG=False
47+ SEND_EMAILS=True
48+ PLS_URL=https://pls.datasektionen.se
49+ LOGIN_API_URL=https://login.datasektionen.se # TODO: migrate to sso (internal)
50+ LOGIN_FRONTEND_URL=https://login.datasektionen.se # TODO: migrate to sso
51+ SPAM_URL=https://spam.datasektionen.se
52+ BUDGET_URL=https://budget.datasektionen.se
53+ GIT_REV=please-delete-from-code
54+ PYTHONUNBUFFERED=1
55+ ENV
56+ destination = " local/.env"
57+ env = true
58+ }
59+ }
60+ }
61+ }
62+
63+ variable "image_tag" {
64+ type = string
65+ default = " ghcr.io/datasektionen/cashflow:latest"
66+ }
You can’t perform that action at this time.
0 commit comments