Add explicit Forgejo deployment structure with artifact build pipeline

- Introduce clear directory separation for docker, infra, ci, and config
- Add CloudFormation pipeline for S3 → CodeBuild → ECR
- Implement explicit artifact build script for flat deployment zip
- Provide example runtime configuration and ignore secrets
This commit is contained in:
Daisuke Nakahara 2025-12-30 16:37:09 +09:00
commit 46ec47aa2d
8 changed files with 323 additions and 0 deletions

18
ci/buildspec.yml Normal file
View file

@ -0,0 +1,18 @@
version: 0.2
phases:
pre_build:
commands:
- set -e
- ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
- REPOSITORY_URI=${ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/forgejo-repository
- aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${REPOSITORY_URI}
- GIT_TAG=$(date +%s)
build:
commands:
- set -e
- docker build -t ${REPOSITORY_URI}:${GIT_TAG} -t ${REPOSITORY_URI}:latest .
post_build:
commands:
- set -e
- docker push ${REPOSITORY_URI}:${GIT_TAG}
- docker push ${REPOSITORY_URI}:latest