Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added genApi step before build image #235

Merged
merged 1 commit into from
Oct 24, 2024
Merged
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
24 changes: 24 additions & 0 deletions .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,27 @@ env:
IMAGE_NAME: traportfolio-ui

jobs:
# API生成部分をDockerのビルド部分から分離
genApi:
name: Generate APIs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- run: npm ci
- run: npm run gen-api
- uses: actions/upload-artifact@v4
with:
name: apis
path: ./src/lib/apis/generated

build-preview-image:
name: Build Preview Image
needs:
- genApi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -37,6 +56,11 @@ jobs:
username: traptitech
password: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/download-artifact@v4
with:
name: apis
path: ./src/lib/apis/generated

# Docker 内でビルドを行うことで、write perm つきでの任意コード実行を避ける
# workflow 自体の改竄はないが、悪意のあるソースコードが入った場合に secret が抽出される可能性があるためである
- name: Build
Expand Down
Loading