Skip to content

Commit

Permalink
Merge pull request #379 from datasektionen/main
Browse files Browse the repository at this point in the history
Bring prod up to speed with main
  • Loading branch information
Theodorgod authored Jan 26, 2025
2 parents afae0c9 + b97287b commit 5ad0c6b
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 82 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/build.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/deploy-dev.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Deploy to Preview Environment

on:
push:
branches: [ main ]
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy to Nomad
uses: datasektionen/nomad-deploy@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
nomad-token: ${{ secrets.NOMAD_TOKEN }}
nomad-addr: ${{ vars.NOMAD_ADDR }}
job-file-path: preview.nomad.hcl
image-tag: preview
17 changes: 17 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Deploy to Production Environment

on:
push:
branches: [ production ]
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy to Nomad
uses: datasektionen/nomad-deploy@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
nomad-token: ${{ secrets.NOMAD_TOKEN }}
nomad-addr: ${{ vars.NOMAD_ADDR }}
28 changes: 0 additions & 28 deletions .github/workflows/deploy.yml

This file was deleted.

50 changes: 50 additions & 0 deletions job.nomad.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
job "ddagen" {
type = "service"
namespace = "ddagen"

group "ddagen" {
network {
port "http" { }
}

service {
name = "ddagen"
port = "http"
provider = "nomad"
tags = [
"traefik.enable=true",
"traefik.http.routers.ddagen.rule=Host(`ddagen.se`)||Host(`www.ddagen.se`)",
"traefik.http.routers.ddagen.tls.certresolver=default",
]
}

task "ddagen" {
driver = "docker"

config {
image = var.image_tag
ports = ["http"]
}

template {
data = <<ENV
PORT={{ env "NOMAD_PORT_http" }}
{{ with nomadVar "nomad/jobs/ddagen" }}
DATABASE_URL=postgres://ddagen:{{ .db_password }}@postgres.dsekt.internal:5432/ddagen
SPAM_API_KEY={{ .spam_api_key }}
{{ end }}
NODE_ENV=production
PLS_URL=http://pls.nomad.dsekt.internal
SPAM_URL=https://spam.datasektionen.se/api/sendmail
ENV
destination = "local/.env"
env = true
}
}
}
}

variable "image_tag" {
type = string
default = "ghcr.io/datasektionen/ddagen:latest"
}
50 changes: 50 additions & 0 deletions preview.nomad.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
job "ddagen-dev" {
type = "service"
namespace = "ddagen"

group "ddagen-dev" {
network {
port "http" { }
}

service {
name = "ddagen-dev"
port = "http"
provider = "nomad"
tags = [
"traefik.enable=true",
"traefik.http.routers.ddagen-dev.rule=Host(`dev.ddagen.se`)",
"traefik.http.routers.ddagen-dev.tls.certresolver=default",
]
}

task "ddagen-dev" {
driver = "docker"

config {
image = var.image_tag
ports = ["http"]
}

template {
data = <<ENV
PORT={{ env "NOMAD_PORT_http" }}
{{ with nomadVar "nomad/jobs/ddagen-dev" }}
DATABASE_URL=postgres://ddagen-dev:{{ .db_password }}@postgres.dsekt.internal:5432/ddagen-dev
SPAM_API_KEY={{ .spam_api_key }}
{{ end }}
NODE_ENV=production
PLS_URL=http://pls.nomad.dsekt.internal
SPAM_URL=https://spam.datasektionen.se/api/sendmail
ENV
destination = "local/.env"
env = true
}
}
}
}

variable "image_tag" {
type = string
default = "ghcr.io/datasektionen/ddagen:preview"
}
Binary file added public/img/d-dagen-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default {
stats: {
firstPart: "100+ exhibitors",
secondPart: "3000+ participants",
thirdPart: "October 9, 10:00 AM - 4:00 PM",
thirdPart: "October 9th, 10:00 AM - 4:00 PM",
},
countDown:{
days: "days",
Expand Down Expand Up @@ -588,7 +588,7 @@ export default {
table1row3: "WHERE IS D-DAGEN?",
table1text1:
"D-Dagen is the annual career fair organized by the Computer Science chapter at KTH Royal Institute of Technology. It is today the largest IT career fair in the Nordic region.",
table1text2: "This year's D-Dagen is taking place on October 9.",
table1text2: "This year's D-Dagen is taking place on October 9th.",
table1text3:
"D-Dagen will be held at Nymble, the student union house, located at the KTH Royal Institute of Technlogy in Stockholm.",
table2row1: "CAN OUR COMPANY GET MORE EXPOSURE?",
Expand Down
8 changes: 4 additions & 4 deletions src/pages/om-oss.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ function stripLastName(name: string) {
return name.split(" ")[0].toLocaleLowerCase();
}

const managersName = ["Toshihide Sakao", "William Nordwall"]
const managersName = ["Max Berglund", "Mortada Nasser"]
const prNames = ["Felicia Murkes","Cissy Yang","Emilie Cao","Julia Potrus","Robert Rosenquist"]
const devNames = ["Viktor Rönnbacka Nybäck", "Nils Malmberg", "Sofia Edvardsson", "Ivar Boqvist"]
const salesNames = ["Linus Markström", "Leo Modahed", "Johanna Plant", "Ella Hedberg", "Mimmi Weng", "Samuel Flodin", "Oskar Furuhed", "Farhan Syed"]
const massNames = ["Mortada Nasser", "Abhinav Sasikumar","Arman Montazeri","Max Berglund", "Adam Njegovanovic","Abdelrahman Aldaker"]
const salesNames = ["Oskar Furuhed", "Leo Modahed", "Johanna Plant", "Ella Hedberg", "Mimmi Weng", "Samuel Flodin", "Oskar Furuhed", "Farhan Syed"]
const massNames = ["Felicia Murkes", "Abhinav Sasikumar","Arman Montazeri","Max Berglund", "Adam Njegovanovic","Abdelrahman Aldaker"]
const ecoNames = ["Oscar Witt","Roger Chen"]

const managersImages = managersName.map(stripLastName).map(formatImagePath);
Expand Down Expand Up @@ -145,7 +145,7 @@ export default function AboutUs() {
<div className="w-full grid grid-cols-1 lg:grid-cols-2 md:gap-8 gap-0 mt-0 lg:mt-12 ">
<Team
teamIndivudualImages={managersImages}
teamPic="/img/projectGroup/g_dda.jpg"
teamPic="/img/projectGroup/g_leadgroup.jpg"
names={managersName}
teamRoles={t.aboutUs.ddaRoles}
teamName={t.aboutUs.teamNames[0]}
Expand Down
1 change: 1 addition & 0 deletions src/utils/send-email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default async function sendEmail(
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
key: env.SPAM_API_KEY,
template: "none",
from: "no-reply@datasektionen.se",
replyTo,
to,
Expand Down

0 comments on commit 5ad0c6b

Please sign in to comment.