This repository has been archived by the owner on Aug 30, 2024. It is now read-only.
forked from puzzle/pitc-revealjs-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (73 loc) · 2.5 KB
/
pages.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
on:
push:
branches:
- master
tags:
- '*'
jobs:
pages:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Build theme
run: |
npm install
npm run build
- id: git-tag
name: Split tag
if: github.ref_type == 'tag'
uses: auguwu/git-tag-action@master
- name: Create tag directories
if: github.ref_type == 'tag'
run: |
mkdir -p build/${{ steps.git-tag.outputs.major }}
cp theme/technative.css build/${{ steps.git-tag.outputs.major }}
mkdir -p build/${{ steps.git-tag.outputs.major }}.${{ steps.git-tag.outputs.minor }}
cp theme/technative.css build/${{ steps.git-tag.outputs.major }}.${{ steps.git-tag.outputs.minor }}
mkdir -p build/${{ github.ref_name }}
cp theme/technative.css build/${{ github.ref_name }}
- name: Create sha and latest directories
run: |
# Short sha
mkdir -p build/${GITHUB_SHA::7}
cp theme/technative.css build/${GITHUB_SHA::7}
# Long sha
mkdir -p build/${GITHUB_SHA}
cp theme/technative.css build/${GITHUB_SHA}
# Latest
mkdir -p build/latest
cp theme/technative.css build/latest
ls -R build
- name: Copy demo presentation
run: |
# Clean old state
rm -rf build/demo/
# We cannot put it in the root, because old files are not removed
cp -r _static build/demo
# Because the static build includes a _assets directory
touch build/.nojekyll
cat <<EOF > build/index.html
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=./demo">
<script type="text/javascript">
window.location.href = "demo"
</script>
<title>Page Redirection</title>
</head>
<body>
If you are not redirected automatically, follow this <a href='demo'>link to example</a>.
</body>
</html>
EOF
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build # The folder the action should deploy.
clean: false