chore: heygermany customer project
This commit is contained in:
56
.github/actions/detect-changes/action.yml
vendored
Normal file
56
.github/actions/detect-changes/action.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
name: Detect Changes
|
||||
description: Detect changed files and handle [deploy-all] commit override
|
||||
|
||||
outputs:
|
||||
api:
|
||||
description: Whether API changed
|
||||
value: ${{ steps.override.outputs.api }}
|
||||
dbmigrate:
|
||||
description: Whether DBMigrate changed
|
||||
value: ${{ steps.override.outputs.dbmigrate }}
|
||||
website:
|
||||
description: Whether WebSite changed
|
||||
value: ${{ steps.override.outputs.website }}
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: generated-code
|
||||
path: ${{ github.workspace }}
|
||||
|
||||
- id: filter
|
||||
uses: dorny/paths-filter@v3
|
||||
with:
|
||||
filters: |
|
||||
api:
|
||||
- 'backends/express/**'
|
||||
- 'sql/**'
|
||||
- 'packages/**'
|
||||
website:
|
||||
- 'apps/website/**'
|
||||
- 'packages/**'
|
||||
|
||||
- id: override
|
||||
shell: bash
|
||||
run: |
|
||||
COMMIT_MESSAGE="${{ github.event.head_commit.message }}"
|
||||
FORCE_PUSH="${{ github.event.forced }}"
|
||||
|
||||
echo "Commit message: $COMMIT_MESSAGE"
|
||||
echo "Forced push: $FORCE_PUSH"
|
||||
|
||||
# Temporarily always return true for all services
|
||||
echo "api=true" >> $GITHUB_OUTPUT
|
||||
echo "website=true" >> $GITHUB_OUTPUT
|
||||
|
||||
# if [ "$FORCE_PUSH" = "true" ] || echo "$COMMIT_MESSAGE" | grep -q "\[deploy-all\]"; then
|
||||
# echo "api=true" >> $GITHUB_OUTPUT
|
||||
# echo "website=true" >> $GITHUB_OUTPUT
|
||||
# else
|
||||
# echo "api=${{ steps.filter.outputs.api }}" >> $GITHUB_OUTPUT
|
||||
# echo "website=${{ steps.filter.outputs.website }}" >> $GITHUB_OUTPUT
|
||||
# fi
|
||||
67
.github/actions/ecr-build-and-push/action.yml
vendored
Normal file
67
.github/actions/ecr-build-and-push/action.yml
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
name: Build and Push to ECR
|
||||
description: Fully prepares, builds, and pushes a Docker image to AWS ECR.
|
||||
|
||||
inputs:
|
||||
dockerfile:
|
||||
description: 'Path to Dockerfile'
|
||||
required: true
|
||||
image-name:
|
||||
description: 'ECR repo name (e.g. api or dbmigrate)'
|
||||
required: true
|
||||
aws-region:
|
||||
description: 'AWS region'
|
||||
required: true
|
||||
aws-access-key-id:
|
||||
description: 'AWS Access Key ID'
|
||||
required: true
|
||||
aws-secret-access-key:
|
||||
description: 'AWS Secret Access Key'
|
||||
required: true
|
||||
github-sha:
|
||||
description: 'Commit SHA to tag the image with'
|
||||
default: ${{ github.sha }}
|
||||
|
||||
outputs:
|
||||
ecr_image:
|
||||
description: 'Final ECR image URI'
|
||||
value: ${{ steps.build.outputs.ecr_image }}
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup AWS Credentials
|
||||
uses: aws-actions/configure-aws-credentials@v1
|
||||
with:
|
||||
aws-access-key-id: ${{ inputs.aws-access-key-id }}
|
||||
aws-secret-access-key: ${{ inputs.aws-secret-access-key }}
|
||||
aws-region: ${{ inputs.aws-region }}
|
||||
|
||||
- name: Login to Amazon ECR
|
||||
id: ecr-login
|
||||
uses: aws-actions/amazon-ecr-login@v1
|
||||
|
||||
- name: Download generated files
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: generated-code
|
||||
path: ${{ github.workspace }}
|
||||
|
||||
- name: List generated files
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Listing .gen.ts and .gen.d.ts files:"
|
||||
pwd
|
||||
find . -name "*.gen.ts" -o -name "*.gen.d.ts"
|
||||
|
||||
- name: Build and Push Docker Image
|
||||
shell: bash
|
||||
id: build
|
||||
run: |
|
||||
IMAGE_URI=${{ steps.ecr-login.outputs.registry }}/${{ inputs.image-name }}:${{ inputs.github-sha }}
|
||||
docker build -t $IMAGE_URI -f ${{ inputs.dockerfile }} .
|
||||
docker tag $IMAGE_URI ${{ steps.ecr-login.outputs.registry }}/${{ inputs.image-name }}:latest
|
||||
docker push $IMAGE_URI
|
||||
docker push ${{ steps.ecr-login.outputs.registry }}/${{ inputs.image-name }}:latest
|
||||
# Safe base64 encode and output
|
||||
IMAGE_URI_BASE64=$(echo -n "$IMAGE_URI" | base64 | tr -d '\n')
|
||||
echo "ecr_image=$IMAGE_URI_BASE64" >> $GITHUB_OUTPUT
|
||||
45
.github/actions/setup-environment/action.yml
vendored
Normal file
45
.github/actions/setup-environment/action.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: 'Setup Environment'
|
||||
description: 'Setup environment for the project'
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: 1.3.14
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Cache bun install
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.bun/install/cache
|
||||
node_modules/.cache
|
||||
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
|
||||
|
||||
- run: bun install --frozen-lockfile
|
||||
shell: bash
|
||||
|
||||
- run: bun run prebuild
|
||||
shell: bash
|
||||
|
||||
- name: List generated files
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Listing .gen.ts and .gen.d.ts files:"
|
||||
find . -name "*.gen.ts" -o -name "*.gen.d.ts"
|
||||
|
||||
- name: Save generated types
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: generated-code
|
||||
path: |
|
||||
${{ github.workspace }}/packages/functions/.pikku
|
||||
${{ github.workspace }}/packages/sdk/.generated
|
||||
${{ github.workspace }}/packages/sdk/.pikku
|
||||
${{ github.workspace }}/apps/website/pikku/*
|
||||
${{ github.workspace }}/apps/website/public/locales
|
||||
${{ github.workspace }}/apps/website/public/locales/*
|
||||
include-hidden-files: true
|
||||
Reference in New Issue
Block a user