-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (68 loc) · 2.68 KB
/
build-and-deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
on:
workflow_call:
jobs:
build:
timeout-minutes: 5
permissions:
contents: read
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
# 「user-data」フォルダへ現在のデータを展開
- id: download-artifacts-from-fetch-catalogue-build-and-deploy
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe #v3.1.4
with:
path: ./user-data
workflow: fetch-catalogue-build-and-deploy.yaml
name: user-data
search_artifacts: true
workflow_conclusion: ''
if_no_artifact_found: ignore
- if: ${{ steps.download-artifacts-from-fetch-catalogue-build-and-deploy.outputs.found_artifact != 'true' }}
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe #v3.1.4
with:
path: ./user-data
workflow: on-push.yaml
name: user-data
search_artifacts: true
workflow_conclusion: ''
- uses: actions/setup-node@v3
with:
node-version: '20'
# https://docs.github.com/ja/actions/using-workflows/caching-dependencies-to-speed-up-workflows#example-using-the-cache-action
- name: Cache node modules
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }}
name: List the state of node modules
continue-on-error: true
run: npm list
- run: npm ci --production
- run: npm run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs
deploy:
needs: build
timeout-minutes: 2
permissions:
pages: write
id-token: write
runs-on: ubuntu-22.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4