-
-
Notifications
You must be signed in to change notification settings - Fork 17
66 lines (61 loc) · 1.75 KB
/
gh-pages-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
name: Deploy to GitHub Pages
on:
push:
branches:
- main
paths:
- .github/workflows/gh-pages-deploy.yaml
- frontend/**
jobs:
gh-pages-deploy:
name: Deploying to GitHub Pages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Install packages
run: |
cd frontend
npm install
cd ..
- name: Generate build number and date
run: |
APP_BUILD_NUM=$GITHUB_RUN_NUMBER.$GITHUB_SHA
APP_BUILD_DATE=`date`
cat << EOF > frontend/.env.production
VUE_APP_BUILD_NUM=$APP_BUILD_NUM
VUE_APP_BUILD_DATE=$APP_BUILD_DATE
VUE_APP_BACKEND_API_URI=https://api.xivtodo.com
VUE_APP_DISCORD_CLIENT_ID=933567168912719923
VUE_APP_DISCORD_REDIRECT_URI=https://xivtodo.com/auth
EOF
- name: Build and deploy to gh-pages
run: |
git checkout --orphan gh-pages-test
cd frontend
npm run build
paths=(
"profile"
"encounters"
"questlines"
"challenges"
"checklist"
"settings"
"help"
"privacy"
)
for path in ${paths[@]}; do
mkdir -p dist/$path
cp dist/index.html dist/$path/index.html
done
git --work-tree dist add --all
git --work-tree dist commit -m "Automated dist build"
git push origin HEAD:gh-pages --force