Skip to content
Merged

Way #21

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/settings.json
1 change: 1 addition & 0 deletions .claude/skills
1 change: 1 addition & 0 deletions .codex/AGENTS.md
1 change: 1 addition & 0 deletions .codex/config.toml
1 change: 1 addition & 0 deletions .codex/skills
13 changes: 0 additions & 13 deletions .dockerignore

This file was deleted.

1 change: 1 addition & 0 deletions .dockerignore
26 changes: 0 additions & 26 deletions .github/workflows/ci.yaml

This file was deleted.

61 changes: 14 additions & 47 deletions .github/workflows/cd.yaml → .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CD
name: Deploy
on:
push:
branches:
Expand All @@ -15,7 +15,7 @@ on:
- qa
- prod
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.inputs.environment_name }}
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.event.inputs.environment_name }}
cancel-in-progress: true
jobs:
set-env:
Expand All @@ -26,40 +26,11 @@ jobs:
image_tag: ${{ steps.set-env.outputs.image_tag }}
steps:
- uses: actions/checkout@v6
- name: Set Environmet
id: set-env
run: |
# Environment
IS_WORKFLOW_DISPATCH="${{ github.event_name == 'workflow_dispatch' && github.event.inputs.environment_name != '' }}"
IS_PUSH_TO_MAIN="${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.base_ref == 'main') }}"
if [ $IS_WORKFLOW_DISPATCH = "true" ]; then
export TARGET_ENVIRONMENT="${{ github.event.inputs.environment_name }}"
elif [ $IS_PUSH_TO_MAIN = "true" ]; then
export TARGET_ENVIRONMENT="stg"
else
exit 1
fi

echo "Environment: $TARGET_ENVIRONMENT"

# Service name suffix
if [ "$TARGET_ENVIRONMENT" = "prod" ]; then
export SERVICE_NAME_SUFFIX=""
else
export SERVICE_NAME_SUFFIX="-$TARGET_ENVIRONMENT"
fi

export REPO_NAME=$(echo ${{ github.repository }} | awk -F '/' '{print $2}')
export SERVICE_NAME=$REPO_NAME$SERVICE_NAME_SUFFIX
export IMAGE_TAG=${{ vars._AR_HOSTNAME }}/${{ vars.PROJECT_ID }}/github-actions/$REPO_NAME/$SERVICE_NAME:${{ github.sha }}

echo "Repository name: $REPO_NAME"
echo "Service name: $SERVICE_NAME"
echo "Image tag: $IMAGE_TAG"

echo "environment=$TARGET_ENVIRONMENT" >> "$GITHUB_OUTPUT"
echo "service_name=$SERVICE_NAME" >> "$GITHUB_OUTPUT"
echo "image_tag=$IMAGE_TAG" >> "$GITHUB_OUTPUT"
- id: set-env
uses: fun-dotto/way/.github/actions/set-env@main
with:
ar_hostname: ${{ vars._AR_HOSTNAME }}
project_id: ${{ vars.PROJECT_ID }}
build-and-push:
runs-on: ubuntu-latest
permissions:
Expand All @@ -72,21 +43,21 @@ jobs:
- set-env
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: true
- name: Build
run: |
docker build \
-t ${{ env.IMAGE_TAG }} \
. \
-f Dockerfile \
--no-cache
- name: Authenticate
id: auth
uses: google-github-actions/auth@v2
- uses: google-github-actions/auth@v3
with:
workload_identity_provider: ${{ vars.WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ vars.SERVICE_ACCOUNT }}
- name: Setup Google Cloud
uses: google-github-actions/setup-gcloud@v2
- uses: google-github-actions/setup-gcloud@v3
with:
project_id: ${{ vars.PROJECT_ID }}
- name: Configure Docker
Expand All @@ -110,15 +81,11 @@ jobs:
- set-env
- build-and-push
steps:
- name: Authenticate
id: auth
uses: google-github-actions/auth@v2
- uses: google-github-actions/auth@v3
with:
workload_identity_provider: ${{ vars.WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ vars.SERVICE_ACCOUNT }}
- name: Deploy
id: deploy
uses: google-github-actions/deploy-cloudrun@v2
- uses: google-github-actions/deploy-cloudrun@v3
with:
service: ${{ env.SERVICE_NAME }}
image: ${{ env.IMAGE_TAG }}
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test
on:
push:
branches:
- main
pull_request:
branches:
- main
types:
- opened
- ready_for_review
- reopened
- synchronize
workflow_dispatch:
jobs:
test:
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous in-repo CI job explicitly skipped draft PRs (if: github.event.pull_request.draft == false). This caller workflow no longer has that guard, so tests will run on draft PR events (e.g., opened). If the prior behavior is still desired, add the draft condition at the job level in this workflow.

Suggested change
test:
test:
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false

Copilot uses AI. Check for mistakes.
uses: fun-dotto/way/.github/workflows/backend-test.yml@main
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow calls a reusable workflow pinned to @main. Pin to a tag or commit SHA to avoid unexpected changes in CI behavior (and to make builds reproducible).

Suggested change
uses: fun-dotto/way/.github/workflows/backend-test.yml@main
uses: fun-dotto/way/.github/workflows/backend-test.yml@v1

Copilot uses AI. Check for mistakes.
permissions:
contents: read
secrets: inherit
11 changes: 11 additions & 0 deletions .github/workflows/update-submodules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Update Submodules
on:
schedule:
- cron: "0 15 * * *"
workflow_dispatch:
jobs:
update-submodules:
uses: fun-dotto/way/.github/workflows/update-submodules.yml@main
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reusable workflow is referenced by a floating ref (@main). For supply-chain safety and reproducibility, pin this to an immutable ref (a tag or commit SHA). This reduces the risk of unexpected behavior changes impacting scheduled runs.

Suggested change
uses: fun-dotto/way/.github/workflows/update-submodules.yml@main
uses: fun-dotto/way/.github/workflows/update-submodules.yml@f3a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8

Copilot uses AI. Check for mistakes.
permissions:
contents: write
pull-requests: write
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "way"]
path = way
url = git@github.com:fun-dotto/way.git
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using an SSH URL for the submodule (git@github.com:...) will fail in GitHub Actions (and for many contributors) unless SSH keys are explicitly configured. Prefer an HTTPS URL (e.g., https://github.com/fun-dotto/way.git) or add explicit SSH key setup in workflows that checkout submodules.

Suggested change
url = git@github.com:fun-dotto/way.git
url = https://github.com/fun-dotto/way.git

Copilot uses AI. Check for mistakes.
16 changes: 0 additions & 16 deletions .mcp.json

This file was deleted.

1 change: 1 addition & 0 deletions .mcp.json
24 changes: 0 additions & 24 deletions CLAUDE.md

This file was deleted.

1 change: 1 addition & 0 deletions CLAUDE.md
53 changes: 0 additions & 53 deletions Dockerfile

This file was deleted.

1 change: 1 addition & 0 deletions Dockerfile
56 changes: 0 additions & 56 deletions Taskfile.yaml

This file was deleted.

1 change: 1 addition & 0 deletions Taskfile.yml
3 changes: 0 additions & 3 deletions mise.toml

This file was deleted.

1 change: 1 addition & 0 deletions mise.toml
1 change: 1 addition & 0 deletions way
Submodule way added at 283653
Loading