File tree Expand file tree Collapse file tree 8 files changed +147
-24
lines changed
Expand file tree Collapse file tree 8 files changed +147
-24
lines changed Original file line number Diff line number Diff line change 1+ name : " NPM Cache Action"
2+ description : " Initialize NPM Cache"
3+ runs :
4+ using : " composite"
5+ steps :
6+ - uses : actions/cache@v3
7+ id : " npm-cache" # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
8+ with :
9+ path : " ./node_modules"
10+ key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
11+ restore-keys : |
12+ ${{ runner.os }}-node-
Original file line number Diff line number Diff line change 1+ name : Init Workflow
2+
3+ on :
4+ workflow_call :
5+
6+ jobs :
7+ init :
8+ name : Init
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : 🛑 Cancel Previous Runs
12+ uses : styfle/cancel-workflow-action@0.9.1
13+
14+ - name : ⬇️ Checkout repo
15+ uses : actions/checkout@v3
16+
17+ - name : 🔄 Init Cache Default
18+ uses : ./.github/actions/npm-cache
19+
20+ - name : 📥 Download deps default-npm-cache
21+ if : steps.npm-cache.outputs.cache-hit != 'true'
22+ uses : bahmutov/npm-install@v1
Original file line number Diff line number Diff line change 1+ name : Build Pages
2+
3+ on :
4+ workflow_call :
5+
6+ jobs :
7+ build :
8+ name : Build
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : ⬇️ Checkout repo
12+ uses : actions/checkout@v3
13+
14+ - name : 🔄 Init Cache
15+ uses : ./.github/actions/npm-cache
16+
17+ - name : 🍼 Create pages build
18+ run : npm run build
19+
20+ - name : ⬆️Upload build
21+ uses : actions/upload-artifact@v3
22+ with :
23+ name : build
24+ path : public
Original file line number Diff line number Diff line change 1+ name : Lint
2+
3+ on :
4+ workflow_call :
5+
6+ jobs :
7+ lint :
8+ name : Lint
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : ⬇️ Checkout repo
12+ uses : actions/checkout@v3
13+
14+ - name : 🔄 Init Cache
15+ uses : ./.github/actions/npm-cache
16+
17+ - name : ⚡ Run Test
18+ run : npm run lint
Original file line number Diff line number Diff line change 1+ name : Test
2+
3+ on :
4+ workflow_call :
5+
6+ jobs :
7+ test :
8+ name : Test
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : ⬇️ Checkout repo
12+ uses : actions/checkout@v3
13+
14+ - name : 🔄 Init Cache
15+ uses : ./.github/actions/npm-cache
16+
17+ - name : ⚡ Run Test
18+ run : npm run test
Original file line number Diff line number Diff line change 1+ name : Deploy to gh-pages
2+
3+ on :
4+ workflow_call :
5+
6+ jobs :
7+ deploy :
8+ name : Deploy
9+ runs-on : ubuntu-latest
10+ concurrency :
11+ group : ${{ github.workflow }}-${{ github.ref }}
12+ steps :
13+ - name : ⬇️ Checkout repo
14+ uses : actions/checkout@v3
15+
16+ - name : 🔄 Init Cache
17+ uses : ./.github/actions/npm-cache
18+
19+ - name : ⬇️Download build
20+ uses : actions/download-artifact@v3
21+ with :
22+ name : build
23+ path : public
24+
25+ - name : 🥅 Deploy to GH-Pages
26+ uses : peaceiris/actions-gh-pages@v3
27+ with :
28+ github_token : ${{ secrets.GITHUB_TOKEN }}
29+ publish_dir : ./public
Original file line number Diff line number Diff line change 1+ name : Default push workflow
2+
3+ on : [push]
4+
5+ jobs :
6+ init :
7+ uses : ./.github/workflows/00-init.yml
8+
9+ lint :
10+ uses : ./.github/workflows/01-lint.yml
11+ needs : [init]
12+
13+ test :
14+ uses : ./.github/workflows/01-test.yml
15+ needs : [init]
16+
17+ build :
18+ uses : ./.github/workflows/01-build.yml
19+ needs : [init]
20+
21+ deploy :
22+ if : contains( github.ref, 'main')
23+ uses : ./.github/workflows/02-deploy-gh-pages.yml
24+ needs : [lint, test, build]
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments