Skip to content

Commit 8c737ea

Browse files
committed
change
1 parent 27fb2fc commit 8c737ea

File tree

13 files changed

+219
-4
lines changed

13 files changed

+219
-4
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ indent_size = 2
3030
[Makefile]
3131
indent_style = tab
3232

33-
[*.tf]
33+
[{*.tf,*.tofu}]
3434
indent_size = 2

.github/workflows/build-backend.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
build:
1010
name: Build
11-
runs-on: [self-hosted]
11+
runs-on: [self-hosted, arm64-fargate]
1212
steps:
1313
- uses: actions/checkout@v4
1414
with:

.github/workflows/build-frontend.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212
build:
1313
name: Build
14-
runs-on: [self-hosted]
14+
runs-on: [self-hosted, arm64-fargate]
1515
steps:
1616
- uses: actions/checkout@v4
1717
with:

.github/workflows/build-pretix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
build:
1010
name: Build pretix
11-
runs-on: [self-hosted]
11+
runs-on: [self-hosted, arm64-fargate]
1212
steps:
1313
- uses: actions/checkout@v4
1414
with:
458 Bytes
Binary file not shown.

infrastructure/tools/.terraform.lock.hcl

Lines changed: 77 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
opentofu 1.8.8
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
data "github_repository" "pycon" {
2+
full_name = "pythonitalia/pycon"
3+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
data "aws_iam_policy_document" "github_runner_assume_role" {
2+
statement {
3+
effect = "Allow"
4+
5+
principals {
6+
type = "Service"
7+
identifiers = ["lambda.amazonaws.com"]
8+
}
9+
10+
actions = ["sts:AssumeRole"]
11+
}
12+
}
13+
14+
resource "aws_iam_role" "github_runner_iam" {
15+
name = "github_runner_iam"
16+
assume_role_policy = data.aws_iam_policy_document.github_runner_assume_role.json
17+
}
18+
19+
resource "aws_iam_role_policy" "github_runner_lambda_policy" {
20+
name = "github_runner_lambda_policy"
21+
role = aws_iam_role.github_runner_iam.id
22+
23+
policy = jsonencode({
24+
Version = "2012-10-17"
25+
Statement = [
26+
{
27+
Effect = "Allow"
28+
Action = [
29+
"logs:CreateLogGroup",
30+
"logs:CreateLogStream",
31+
"logs:PutLogEvents"
32+
]
33+
Resource = "*"
34+
}
35+
]
36+
})
37+
}
38+
39+
data "archive_file" "github_runner_webhook_artifact" {
40+
type = "zip"
41+
source_file = "${path.root}/lambdas/github_runner_webhook.py"
42+
output_path = "${path.root}/.archive_files/github_runner_webhook.zip"
43+
}
44+
45+
resource "aws_lambda_function" "github_runner_webhook" {
46+
function_name = "github_runner_webhook"
47+
role = aws_iam_role.github_runner_iam.arn
48+
handler = "github_runner_webhook.handler"
49+
runtime = "python3.13"
50+
filename = data.archive_file.github_runner_webhook_artifact.output_path
51+
source_code_hash = data.archive_file.github_runner_webhook_artifact.output_base64sha256
52+
environment {
53+
variables = {
54+
WEBHOOK_SECRET = random_password.webhook_secret.result
55+
}
56+
}
57+
}
58+
59+
resource "aws_lambda_function_url" "github_runner_webhook" {
60+
function_name = aws_lambda_function.github_runner_webhook.function_name
61+
authorization_type = "NONE"
62+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
resource "random_password" "webhook_secret" {
2+
length = 64
3+
special = true
4+
override_special = "!#$%&*()-_=+[]{}<>:?"
5+
}
6+
7+
resource "github_repository_webhook" "github_runner_notify" {
8+
repository = data.github_repository.pycon.name
9+
events = ["workflow_job"]
10+
active = true
11+
12+
configuration {
13+
url = aws_lambda_function_url.github_runner_webhook.function_url
14+
secret = random_password.webhook_secret.result
15+
content_type = "json"
16+
}
17+
}

0 commit comments

Comments
 (0)