forked from taniarascia/taniarascia.com
-
Notifications
You must be signed in to change notification settings - Fork 6
93 lines (72 loc) · 2.04 KB
/
gatsby-build.yml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
name: Gatsby
on:
push:
branches:
- master
concurrency:
group: gatsby
cancel-in-progress: true
jobs:
build-and-lint:
runs-on: ubuntu-latest
steps:
- name: 🕘 Set runner timezone
uses: szenius/[email protected]
with:
timezoneLinux: "Australia/Sydney"
- name: 🛎️ Check out master branch
uses: actions/checkout@v4
with:
ref: master
- name: 💭 Get nvm version
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
id: nvm
- name: ⚙️ Setup node.js environment
uses: actions/setup-node@v4
with:
node-version: ${{ steps.nvm.outputs.NODE_VERSION }}
- name: 🧶 Get Yarn cache directory
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: 🧶 Get Yarn cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: 🧶 Yarn install
run: yarn install --immutable
- name: 💨 ESLint
run: yarn lint:js
- name: ☄️ markdownlint
run: yarn lint:md
- name: 🥡 Getting Gatsby cache
uses: actions/cache@v3
with:
path: |
public
.cache
key: ${{ runner.os }}-gatsby-build-
restore-keys: |
${{ runner.os }}-gatsby-build-
- name: 🧶 Yarn build
run: yarn build
- name: ⤴️ Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: public
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
needs: build-and-lint
steps:
- name: 🚀 Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4