-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (82 loc) · 2.2 KB
/
Copy pathdeploy.yaml
File metadata and controls
97 lines (82 loc) · 2.2 KB
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
94
95
96
97
name: deploy
on:
push:
branches: [main]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Cache Primes
id: cache-primes
uses: actions/cache@v4
with:
path: cache-images
key: cache-images
- name: Setup Node.js v20.x
uses: actions/setup-node@v4
with:
node-version: 20
- name: Enable Corepack
run: corepack enable
- name: Cache Yarn dependencies
uses: actions/cache@v4
with:
path: |
~/.yarn/berry/cache
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install
run: yarn install
env:
YARN_IGNORE_NODE: 1
- name: Install sharp
run: yarn add sharp
env:
YARN_IGNORE_NODE: 1
- name: Build
run: yarn build
env:
BASE_URL: /
HOSTNAME: https://mc-ctec.org/
- name: deploy
run: |
cd dist
[ -f 404.html ] || ln -s index.html 404.html
if [ "none" != "$cname" ]; then echo "$cname" > CNAME; fi
dirs=(
"home"
"join"
"survival"
"survivalProgress"
"member"
"openSource"
"collaborative"
"partner"
"redstoneCollection"
"architectureCollection"
)
for dir in "${dirs[@]}"; do
mkdir -p "$dir" && cp index.html "$dir/index.html"
done
- name: Fix permissions
run: |
chmod -c -R +rX "_site/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4