-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (73 loc) · 2.61 KB
/
deploy-github-pages.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
name: deploy-github-pages
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
generate-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Update Submodule
run: git pull --recurse-submodules && git submodule update --remote --recursive --init
- name: Commit Changes
uses: EndBug/add-and-commit@v7
with:
message: 'chore: update git submodules'
default_author: github_actions
- name: Copy CHANGELOG.md
run: cp lib/CHANGELOG.md docs/changelog.md
- name: Copy README.md
run: |
rm -rf docs/intro.md
echo "---" >> docs/intro.md
echo "sidebar_position: 1" >> docs/intro.md
echo "title: 'Welcome'" >> docs/intro.md
echo "sidebar_label: 'Welcome'" >> docs/intro.md
echo "slug: /" >> docs/intro.md
echo "---" >> docs/intro.md
cat lib/README.md >> docs/intro.md
- name: Clone Assets
run: |
git clone https://github.com/Statscell/clash-assets.git
cp clash-assets/troops/icons/* -r static/assets
- name: Install
run: yarn
- name: Build
run: yarn build
- name: README.md
run: |
echo "# Documentation Branch" >> build/README.md
echo "This branch hosts the documentation files used for https://clashofclans.js.org/. No manual commits should ever need to be done to this branch." >> build/README.md
echo "## Commits" >> build/README.md
echo "- [clashperk/clashofclans.js@$(git rev-parse --short HEAD:lib)](https://github.com/clashperk/clashofclans.js/commit/$(git rev-parse HEAD:lib))" >> build/README.md
echo "- [clashperk/clashofclans.js.org@$(git rev-parse --short HEAD)](https://github.com/clashperk/clashofclans.js.org/commit/$(git rev-parse HEAD))" >> build/README.md
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./build
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
publish-github-pages:
needs: generate-docs
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2