Skip to content

Commit

Permalink
Build job共通化
Browse files Browse the repository at this point in the history
Fixes #328
  • Loading branch information
ROhta committed Jul 14, 2024
1 parent b49f470 commit dfd89ed
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 24 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/dependency-review-action@v4
Build-Check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
check-latest: true
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build
uses: ./.github/workflows/workflow_call/build-check.yml
with:
node-version: 20
20 changes: 7 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,30 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 20 ]
node-version: [20]
steps:
- name: Confirm Check
if: github.event_name == 'workflow_dispatch' && github.event.inputs.confirm != 'run'
run: echo "Invalid input" && exit 1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: ./.github/workflows/workflow_call/build-check.yml
with:
node-version: ${{ matrix.node-version }}
check-latest: true
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build
- name: Clean Up
run: rm -r src/ts
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'src/'
path: "src/"
Deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs:
- Build
permissions:
pages: write
id-token: write
pages: write
id-token: write
steps:
- id: deployment
uses: actions/deploy-pages@v4
22 changes: 22 additions & 0 deletions .github/workflows/workflow_call/build-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build Check

on:
workflow_call:
inputs:
node-version:
required: true
type: number

jobs:
Build-Check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{inputs.node-version}}
check-latest: true
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build

0 comments on commit dfd89ed

Please sign in to comment.