File tree Expand file tree Collapse file tree 5 files changed +70
-18
lines changed Expand file tree Collapse file tree 5 files changed +70
-18
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@v4
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 medusa
21- 22- with :
23- ssh_private_key : ${{ secrets.MEDUSA_GLOBAL_DEPLOY_KEY }}
24- git_remote_url :
ssh://[email protected] /pandora 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 @@ -29,4 +29,4 @@ RUN ln -s _vendor vendor && chown -R www:www /app
2929EXPOSE 8000
3030
3131USER root
32- CMD ["/app/run.sh " ]
32+ ENTRYPOINT ["sh" , "-c" , "php artisan serve --host=0.0.0.0 --port=$PORT " ]
Original file line number Diff line number Diff line change 11# Pandora
22
3+ > [ !WARNING]
4+ > Migrations not run in production env
5+
36PHP Laravel application that handles bookings. Live at https://bokning.datasektionen.se .
47
58## API
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ services:
1919 - LOGIN_FRONTEND_URL=http://localhost:7002
2020 - PLS_API_URL=https://pls.datasektionen.se/api
2121 - HODIS_API_URL=https://hodis.datasektionen.se
22+ - PORT=8000
2223 depends_on :
2324 db :
2425 condition : service_healthy
Original file line number Diff line number Diff line change 1+ ob "pandora" {
2+ type = " service"
3+
4+ group "pandora" {
5+ network {
6+ port "http" { }
7+ }
8+
9+ service {
10+ name = " pandora"
11+ port = " http"
12+ provider = " nomad"
13+ tags = [
14+ " traefik.enable=true" ,
15+ " traefik.http.routers.pandora.rule=Host(`bokning.datasektionen.se`)" ,
16+ " traefik.http.routers.pandora.tls.certresolver=default" ,
17+ ]
18+ }
19+
20+ task "pandora" {
21+ driver = " docker"
22+
23+ config {
24+ image = var. image_tag
25+ ports = [" http" ]
26+ }
27+
28+ template {
29+ data = << ENV
30+ {{ with nomadVar "nomad/jobs/pandora" }}
31+ DATABASE_URL=postgres://pandora:{{ .db_password }}@postgres.dsekt.internal:5432/pandora
32+ APP_KEY={{ .app_key }}
33+ LOGIN_API_KEY={{ .login_api_key }}
34+ SPAM_API_KEY={{ .spam_api_key }}
35+ {{ end }}
36+ PORT={{ env "NOMAD_PORT_http" }}
37+ APP_DEBUG=false
38+ APP_ENV=production
39+ DB_CONNECTION=pgsql
40+ LOGIN_API_URL=https://login.datasektionen.se
41+ LOGIN_FRONTEND_URL=https://login.datasektionen.se
42+ PLS_API_URL=https://pls.datasektionen.se/api
43+ SPAM_API_URL=https://spam.datasektionen.se/api/sendmail
44+ ENV
45+ destination = " local/.env"
46+ env = true
47+ }
48+
49+ resources {
50+ memory = 120
51+ }
52+ }
53+ }
54+ }
55+
56+ variable "image_tag" {
57+ type = string
58+ default = " ghcr.io/datasektionen/pandora:latest"
59+ }
You can’t perform that action at this time.
0 commit comments