Skip to content

Commit

Permalink
Merge pull request #235 from traPtitech/fix/previewFlow
Browse files Browse the repository at this point in the history
fix: added genApi step before build image
  • Loading branch information
Pugma authored Oct 24, 2024
2 parents bd4dcd2 + 5348512 commit 14216c6
Showing 1 changed file with 24 additions and 0 deletions.
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

0 comments on commit 14216c6

Please sign in to comment.