Skip to content

Commit 0ab7371

Browse files
committed
change
1 parent 1e4b762 commit 0ab7371

File tree

6 files changed

+13
-20
lines changed

6 files changed

+13
-20
lines changed

.github/workflows/build-backend.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ jobs:
1717
with:
1818
ref: ${{ github.ref }}
1919
fetch-depth: 0
20-
- name: Configure AWS credentials
21-
uses: aws-actions/configure-aws-credentials@v4
22-
with:
23-
aws-access-key-id: ${{ secrets.aws_access_key_id }}
24-
aws-secret-access-key: ${{ secrets.aws_secret_access_key }}
25-
aws-region: eu-central-1
2620
- name: Set up QEMU dependency
2721
uses: docker/setup-qemu-action@v3
2822
- name: Log in to the Container registry

.github/workflows/build-pretix.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ jobs:
1414
with:
1515
ref: ${{ github.ref }}
1616
fetch-depth: 0
17-
- name: Configure AWS credentials
18-
uses: aws-actions/configure-aws-credentials@v4
17+
- name: Log in to the Container registry
18+
uses: docker/login-action@v3
1919
with:
20-
aws-access-key-id: ${{ secrets.aws_access_key_id }}
21-
aws-secret-access-key: ${{ secrets.aws_secret_access_key }}
22-
aws-region: eu-central-1
23-
- name: Login to Amazon ECR
24-
uses: aws-actions/amazon-ecr-login@v2
20+
registry: ghcr.io
21+
username: ${{ github.actor }}
22+
password: ${{ secrets.GITHUB_TOKEN }}
2523
- name: Set up Docker Buildx
2624
id: buildx
2725
uses: docker/setup-buildx-action@v3
@@ -33,7 +31,7 @@ jobs:
3331
builder: ${{ steps.buildx.outputs.name }}
3432
provenance: false
3533
push: true
36-
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.eu-central-1.amazonaws.com/pythonit/pretix:arm-${{ inputs.githash }}
34+
tags: ghcr.io/pythonitalia/pycon/pretix:${{ inputs.githash }}
3735
cache-from: type=local,src=/tmp/.buildx-cache
3836
cache-to: type=local,dest=/tmp/.buildx-cache
3937
platforms: linux/arm64

infrastructure/applications/pretix/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ resource "aws_ecs_task_definition" "pretix" {
88
container_definitions = jsonencode([
99
{
1010
name = "pretix"
11-
image = "${data.aws_ecr_repository.repo.repository_url}@${data.aws_ecr_image.image.image_digest}"
11+
image = "ghcr.io/pythonitalia/pycon/pretix:${data.external.githash.result.githash}"
1212
memoryReservation = local.is_prod ? 1500 : 10
1313
essential = true
1414

infrastructure/applications/pycon_backend/web_task.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ resource "aws_ecs_task_definition" "web" {
44
container_definitions = jsonencode([
55
{
66
name = "web"
7-
image = "${data.aws_ecr_repository.be_repo.repository_url}@${data.aws_ecr_image.be_arm_image.image_digest}"
7+
image = local.image
88
memoryReservation = local.is_prod ? 400 : 10
99
essential = true
1010
entrypoint = [

infrastructure/applications/pycon_backend/worker.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ locals {
190190
value = module.common_secrets.value.sns_webhook_secret
191191
}
192192
]
193+
image = "ghcr.io/pythonitalia/pycon/backend:${data.external.githash.result.githash}"
193194
}
194195

195196
resource "aws_iam_role" "ecs_service" {
@@ -215,7 +216,7 @@ resource "aws_ecs_task_definition" "worker" {
215216
container_definitions = jsonencode([
216217
{
217218
name = "worker"
218-
image = "${data.aws_ecr_repository.be_repo.repository_url}@${data.aws_ecr_image.be_arm_image.image_digest}"
219+
image = local.image
219220
memoryReservation = local.is_prod ? 200 : 10
220221
essential = true
221222
entrypoint = [
@@ -259,7 +260,7 @@ resource "aws_ecs_task_definition" "worker" {
259260
},
260261
{
261262
name = "migrations"
262-
image = "${data.aws_ecr_repository.be_repo.repository_url}@${data.aws_ecr_image.be_arm_image.image_digest}"
263+
image = local.image
263264
memoryReservation = local.is_prod ? 200 : 10
264265
essential = false
265266
entrypoint = [
@@ -313,7 +314,7 @@ resource "aws_ecs_task_definition" "beat" {
313314
container_definitions = jsonencode([
314315
{
315316
name = "beat"
316-
image = "${data.aws_ecr_repository.be_repo.repository_url}@${data.aws_ecr_image.be_arm_image.image_digest}"
317+
image = local.image
317318
memoryReservation = local.is_prod ? 200 : 10
318319
essential = true
319320
entrypoint = [

infrastructure/applications/pycon_frontend/task.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ resource "aws_ecs_task_definition" "pycon_frontend" {
1010
container_definitions = jsonencode([
1111
{
1212
name = "frontend"
13-
image = "${aws_ecr_repository.repo.repository_url}@${data.aws_ecr_image.image.image_digest}"
13+
image = "ghcr.io/pythonitalia/pycon/frontend:${data.external.githash.result.githash}"
1414
memoryReservation = local.is_prod ? 400 : 10
1515
essential = true
1616

0 commit comments

Comments
 (0)