1212 pull_request :
1313 workflow_dispatch :
1414
15- defaults :
16- run :
17- working-directory : " ./backend"
18-
1915jobs :
20- test :
21- name : " π§ͺ Testing"
16+ backend- test :
17+ name : " π§ͺ Backend Testing"
2218 runs-on : ubuntu-latest
19+ defaults :
20+ run :
21+ working-directory : " backend"
2322 steps :
2423 - name : " π Checkout"
2524 uses : actions/checkout@v4
2625
2726 - name : " π Set up Poetry"
2827 uses : tomy0000000/actions/python-poetry-install@main
2928 with :
30- working_directory : " ./ backend"
29+ working_directory : " backend"
3130 python_version : " 3.12"
3231
3332 - name : " π§ͺ Testing"
@@ -40,23 +39,55 @@ jobs:
4039 fail_ci_if_error : true
4140 token : ${{ secrets.CODECOV_TOKEN }}
4241
43- lint :
44- name : " π Linting"
42+ backend- lint :
43+ name : " π Backend Linting"
4544 runs-on : ubuntu-latest
45+ defaults :
46+ run :
47+ working-directory : " backend"
4648 steps :
4749 - name : " π Checkout"
4850 uses : actions/checkout@v4
4951
5052 - name : " π Set up Poetry"
5153 uses : tomy0000000/actions/python-poetry-install@main
5254 with :
53- working_directory : " ./ backend"
55+ working_directory : " backend"
5456 python_version : " 3.12"
5557
5658 - name : " π Linting"
5759 run : |
5860 poetry run scripts/lint.sh
5961
62+ frontend-lint :
63+ name : " π Frontend Linting"
64+ runs-on : ubuntu-latest
65+ defaults :
66+ run :
67+ working-directory : " frontend"
68+ steps :
69+ - name : " π Checkout"
70+ uses : actions/checkout@v4
71+
72+ - name : " βοΈ Setup pnpm"
73+ uses : pnpm/action-setup@v4
74+ with :
75+ package_json_file : " frontend/package.json"
76+ run_install : false
77+
78+ - name : " βοΈ Setup Node.js"
79+ uses : actions/setup-node@v4
80+ with :
81+ node-version-file : " frontend/package.json"
82+ cache : " pnpm"
83+ cache-dependency-path : " frontend/pnpm-lock.yaml"
84+
85+ - name : " π¦ Install dependencies"
86+ run : pnpm install --frozen-lockfile
87+
88+ - name : " π Linting"
89+ run : pnpm lint
90+
6091 license :
6192 name : " πͺͺ License Scan"
6293 runs-on : ubuntu-latest
@@ -70,10 +101,13 @@ jobs:
70101 with :
71102 api-key : 2d7865a44aa575d857521faaee1a57f8
72103
73- build :
104+ build-backend :
74105 name : " ποΈ Build Backend Image"
75106 runs-on : ubuntu-latest
76- needs : [test, lint, license]
107+ defaults :
108+ run :
109+ working-directory : " backend"
110+ needs : [backend-test, backend-lint, license]
77111 if : success() && github.ref == 'refs/heads/develop'
78112 steps :
79113 - name : " π Checkout"
@@ -99,4 +133,38 @@ jobs:
99133 docker_password : ${{ secrets.DOCKER_PASSWORD }}
100134 tags : ${{ steps.meta.outputs.tags }}
101135 labels : ${{ steps.meta.outputs.labels }}
102- context : " ./backend"
136+ context : " backend"
137+
138+ build-frontend :
139+ name : " ποΈ Build Frontend Image"
140+ runs-on : ubuntu-latest
141+ defaults :
142+ run :
143+ working-directory : " frontend"
144+ needs : [frontend-lint, license]
145+ if : success() && github.ref == 'refs/heads/develop'
146+ steps :
147+ - name : " π Checkout"
148+ uses : actions/checkout@v4
149+
150+ - name : " βοΈ Setup Docker Meta"
151+ id : meta
152+ uses : docker/metadata-action@v5
153+ with :
154+ images : |
155+ ${{ github.repository }}
156+ ghcr.io/${{ github.repository }}
157+ tags : |
158+ type=edge
159+ labels : |
160+ org.opencontainers.image.title=kayman-frontend
161+ org.opencontainers.image.documentation=${{ github.repository }}/wiki
162+ org.opencontainers.image.authors=tomy0000000
163+
164+ - name : " π Build and Push Image"
165+ uses : tomy0000000/actions/build-push-image@main
166+ with :
167+ docker_password : ${{ secrets.DOCKER_PASSWORD }}
168+ tags : ${{ steps.meta.outputs.tags }}
169+ labels : ${{ steps.meta.outputs.labels }}
170+ context : " frontend"
0 commit comments