File tree Expand file tree Collapse file tree 1 file changed +46
-8
lines changed Expand file tree Collapse file tree 1 file changed +46
-8
lines changed Original file line number Diff line number Diff line change 1111
1212 # Allows you to run this workflow manually from the Actions tab
1313 workflow_dispatch :
14-
15- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16- permissions :
17- contents : read
18- pages : write
19- id-token : write
20-
14+
2115# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
2216# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
2317concurrency :
@@ -26,8 +20,45 @@ concurrency:
2620
2721jobs :
2822 # Build job
23+
24+ format :
25+ runs-on : ubuntu-latest
26+
27+ # Sets permissions of the GITHUB_TOKEN to commit and push the changed files back to the repository.
28+ permissions :
29+ contents : write
30+
31+ steps :
32+ - name : Checkout code
33+ uses : actions/checkout@v4
34+
35+ - name : Set up Node.js
36+ uses : actions/setup-node@v4
37+ with :
38+ node-version : ' 20'
39+ ref : ${{ github.head_ref }}
40+
41+ - name : Install dependencies
42+ run : npm install
43+
44+ - name : Run Prettier
45+ run : npm run format
46+
47+ - name : Run Linter
48+ run : npm run lint
49+
50+ - uses : stefanzweifel/git-auto-commit-action@v5
51+ with :
52+ commit_message : " [GitHub Actions] コードをフォーマット"
53+
2954 build :
3055 runs-on : ubuntu-latest
56+ needs : format
57+
58+ # Sets permissions of the GITHUB_TOKEN to read the repository.
59+ permissions :
60+ contents : read
61+
3162 steps :
3263 - name : Checkout
3364 uses : actions/checkout@v4
@@ -87,7 +118,14 @@ jobs:
87118 url : ${{ steps.deployment.outputs.page_url }}
88119 runs-on : ubuntu-latest
89120 needs : build
121+
122+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
123+ permissions :
124+ contents : read
125+ pages : write
126+ id-token : write
127+
90128 steps :
91129 - name : Deploy to GitHub Pages
92130 id : deployment
93- uses : actions/deploy-pages@v4
131+ uses : actions/deploy-pages@v4
You can’t perform that action at this time.
0 commit comments